Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- string word = " ";
- while (word != "Exit")
- {
- Console.WriteLine("Введите слово");
- word = Console.ReadLine();
- Console.Clear();
- Console.WriteLine($"{word} - {word = ValueSearch(word)}");
- Console.ReadKey();
- Console.Clear();
- }
- }
- static string ValueSearch(string word)
- {
- Dictionary<string, string> wordList = new Dictionary<string, string>();
- wordList.Add("Программирование", "Вид деятельности, необходимый для организации решения различных задач на ЭВМ.");
- wordList.Add("ЭВМ", "Электронная вычислительная машина.");
- wordList.Add("ПК", "Персональный компьютер");
- wordList.Add("HDD", "Жёсткий диск, винчестер");
- if(wordList.ContainsKey(word))
- {
- word = wordList[word];
- }
- else
- {
- word = "Данное слово не найдено в словаре";
- }
- return word;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement