Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace phoneBook
- {
- class Program
- {
- static void Main(string[] args)
- {
- string[] phoneNumbers = Console.ReadLine().Split(' ');
- string[] names = Console.ReadLine().Split(' ');
- string[] ownNames = new string[names.Length];
- var index = 0;
- int[] indexInNames = new int[names.Length];
- var run = true;
- while (run)
- {
- var input = Console.ReadLine();
- if (input == "done")
- {
- break;//run = false;
- }
- for (int i = 0; i < names.Length; i++)
- {
- //for (int y = 0; y < ownNames.Length; y++)
- //{
- if (names[i] == input/*ownNames[y]*/)
- {
- index = i; break;
- }
- //}
- }
- //for (int i = 0; i < indexInNames.Length; i++)
- //{
- //if (indexInNames[i] != null)
- //{
- Console.WriteLine(names[index] + " -> " + phoneNumbers[index]);
- //}
- //}
- //ownNames[index] = input;
- //index++;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement