Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace ConsoleTests
- {
- class ConsoleTests
- {
- static void Main()
- {
- Dictionary<string, string> dictionary =
- new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
- dictionary.Add(".NET", "platform for applications from Microsoft");
- dictionary.Add("CLR", "managed execution environment for .NET");
- dictionary.Add("namespace", "hierarchical organization of classes");
- for (int i = 0; i < 10; i++)
- {
- string input = Console.ReadLine();
- if (dictionary.ContainsKey(input))
- {
- string value = dictionary[input];
- Console.WriteLine("\"{0}\"",value);
- }
- else
- {
- Console.WriteLine("Error: word not found in the dictionary.");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment