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 FuckingDotNot
- {
- class Program
- {
- static void Main(string[] args)
- {
- Dictionary<string, string> phoneBook = new Dictionary<string, string>();
- string input = Console.ReadLine();
- while (input != "END")
- {
- string[] inputParameters = input.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
- if (inputParameters[0] == "A")
- {
- phoneBook[inputParameters[1]] = inputParameters[2];
- }
- else
- {
- if (!phoneBook.ContainsKey(inputParameters[1]))
- {
- Console.WriteLine($"Contact {inputParameters[1]} does not exist.");
- }
- else
- {
- Console.WriteLine($"{inputParameters[1]} -> {phoneBook[inputParameters[1]]}");
- }
- }
- input = Console.ReadLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement