SHOW:
|
|
- or go back to the newest paste.
1 | using System; | |
2 | ||
3 | namespace C_sharp_Light | |
4 | { | |
5 | class Program | |
6 | { | |
7 | static void Main(string[] args) | |
8 | { | |
9 | - | |
9 | + | Dictionary<string, string> dic = new Dictionary<string, string> |
10 | { | |
11 | {"париж", "Столица франции" }, | |
12 | {"школа","Учебное заведение" }, | |
13 | {"лекция","систематическое, последовательное изложение учебного материала" }, | |
14 | {"вуз", "Высшие учебное заведение" } | |
15 | }; | |
16 | ||
17 | string word; | |
18 | bool isOpen = true; | |
19 | ||
20 | while (isOpen) | |
21 | { | |
22 | Console.WriteLine("Команда exit - выход"); | |
23 | Console.WriteLine("Введите слово: "); | |
24 | word = Console.ReadLine(); | |
25 | word.ToLower(); | |
26 | if (word == "exit") | |
27 | isOpen = false; | |
28 | else if (dic.ContainsKey(word)) | |
29 | Console.WriteLine($"Слово *{word}* обозначает - {dic[word]}"); | |
30 | else | |
31 | Console.WriteLine($"{word} - нет в словаре"); | |
32 | ||
33 | Console.ReadKey(); | |
34 | Console.Clear(); | |
35 | } | |
36 | } | |
37 | } | |
38 | } |