Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Phonebook
- {
- class Program
- {
- static void Main(string[] args)
- {
- var phoneArr = Console.ReadLine().Split().ToArray();
- var phone = new string[phoneArr.Length];
- for (var i = 0; i < phoneArr.Length; i++)
- {
- phone[i] = phoneArr[i];
- }
- // telefonnite nomera
- var stringArr = Console.ReadLine().Split().ToArray();
- var arr = new string[stringArr.Length];
- for(var i=0;i<stringArr.Length;i++)
- {
- arr[i] = stringArr[i];
- }
- // imenata
- string names = string.Empty;
- var newArr = new string[arr.Length];
- while(names!="done")
- {
- names = Console.ReadLine();
- for(var i=0;i< arr.Length;i++)
- {
- if(names==arr[i])
- {
- newArr[i] = arr[i];
- }
- }
- }
- for (var i = 0; i < arr.Length; i++)
- {
- if (newArr[i] == arr[i])
- {
- Console.WriteLine("{0} -> {1}",arr[i],phone[i]);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement