Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace CSharpLigth_HomeWork_Dictionary
- {
- class Program
- {
- static void Main(string[] args)
- {
- string errorNoFound = "Такого слова пока нет в нашем словаре.";
- string userValue;
- Dictionary<string, string> words = new Dictionary<string, string>();
- words.Add("группа", "Несколько предметов или людей, животных, расположенных близко друг от друга.");
- words.Add("кот", "Самец кошки");
- Console.Write("Введите слово для поиска в словаре: ");
- userValue = Console.ReadLine();
- if (words.ContainsKey(userValue))
- {
- Console.WriteLine($"{userValue} - {words[userValue]}");
- }
- else
- {
- Console.WriteLine(errorNoFound);
- }
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement