Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
PhoneBook- Dictionary
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { //Your code goes here int n = Int32.Parse(Console.ReadLine()); Dictionary<string,string> phoneBook = new Dictionary<string,string>(); for(int i=0; i<n ; i++){ string[] input =Console.ReadLine().Split(' '); phoneBook.Add(input[0],input[1]); } string name; while ((name = Console.ReadLine()) != null && name != ""){ if(phoneBook.ContainsKey(name)){ Console.WriteLine(name + "="+phoneBook[name]); }else{ Console.WriteLine("Not found"); } } } } }
run
|
edit
|
history
|
help
0
Conditional linq operators
Random name switch
pointoncircle
jjj3
unix practice - santhosh
Checking time span between two timezone times
Robot_Testing
Rextester
Knapsack Problem - recursive
Day1