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 Homework1
- {
- class Program
- {
- static void Main(string[] args)
- {
- bool exit = false;
- Dictionary<string, string> dictionary = new Dictionary<string, string>();
- dictionary.Add("Аберрация", "Искажение наблюдаемых явлений, отход от истинности");
- dictionary.Add("Гамбит", "Приём в шахматной партии, когда игрок сознательно подставляет и жертвует фигуры, с целью получения преимущества при дальнейшем развитии игры");
- dictionary.Add("Герменевтика", "Неизлечимость");
- dictionary.Add("Ультиматум", "Решительное и бескомпромиссное требование, сопровождаемое угрозой");
- dictionary.Add("Цессия", "Передача своих прав другому лицу");
- while (exit == false)
- {
- foreach (var word in dictionary)
- {
- Console.WriteLine(word.Key);
- }
- Console.WriteLine();
- Console.Write("Введите слово, чтобы узнать его значение(либо 'exit' для выхода):");
- string userInput = Console.ReadLine();
- if (dictionary.ContainsKey(userInput))
- {
- Console.WriteLine($"{userInput} - {dictionary[userInput]}");
- }
- else if (userInput == "exit")
- {
- exit = true;
- }
- else
- {
- Console.WriteLine("Слово введено неверно!");
- }
- Console.ReadKey();
- Console.Clear();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment