Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class program
- {
- static void Main(string[] args)
- {
- bool isFound = true;
- Dictionary<string, string> explanatoryDictionary = new Dictionary<string, string>();
- explanatoryDictionary.Add("Футбол", "Football");
- explanatoryDictionary.Add("Баскетбол", "Basketball");
- explanatoryDictionary.Add("Хоккей", "Hockey");
- explanatoryDictionary.Add("Теннис", "Tennis");
- explanatoryDictionary.Add("Гольф", "Golf");
- Console.Write("Введите слово:");
- string userInput = Console.ReadLine();
- foreach(var item in explanatoryDictionary)
- {
- if (item.Key == userInput)
- {
- Console.WriteLine(item.Value);
- isFound = false;
- }
- }
- if (isFound == true)
- {
- Console.WriteLine("Такого слова нет.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement