• + 1 comment

    C# Solution

        Dictionary<string,uint> phoneList = new Dictionary<string,uint>();
    
        int entries = int.Parse(Console.ReadLine());
    
        while(entries > 0)
        {
            string[] entry = Console.ReadLine().Split();
            string name = entry[0];
            uint tel = uint.Parse(entry[1]);
    
            phoneList.Add(name, tel);
    
            entries--;
        }
    
        bool lookUp = true;
    
        while(lookUp)
        {
            string lookFor = Console.ReadLine();
    
            if(lookFor == string.Empty || lookFor == null)
            {
                lookUp = false;
            }            
            else
            {
                if(phoneList.ContainsKey(lookFor))
                {
                    Console.WriteLine("{0}={1}", lookFor, phoneList[lookFor]);
                }
                else Console.WriteLine("Not found");
            }
        }