Untitled
raw download clone
TEXT
views 21
,
size 881 b
using System;
using System.Collections.Generic;
using System.IO;
class Solution {
    public static Dictionary<string, string> phoneDics = 
    new Dictionary<string, string>();

    public static void CheckName(string name)
    {
        if(phoneDics.ContainsKey(name))
        {
            
            string val=phoneDics[name];
            Console.WriteLine(name+"="+val);
            return;
        }
        else
        {
            Console.WriteLine("Not found");
            return;
        }
    }

static void Main(String[] args) {

    int n = Convert.ToInt32(Console.ReadLine());
    string[] a = new string[2];
    for(int i =0;i<n;i++)
    {
        a = Console.ReadLine().Split(' ');
        phoneDics.Add(a[0], a[1]);
    }
    for(int i = 0 ;i<n;i++)
    {
        CheckName(Console.ReadLine());
    }
    return;
    }
}
close fullscreen
Login or Register to edit or fork this paste. It's free.