Advertisement
holllowknight

Толковый словарь

Apr 12th, 2023
641
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.14 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. namespace dictionary
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             Dictionary<string, string> dictionary = new Dictionary<string, string>();
  11.             dictionary.Add("габитус", "Совокупность внешних признаков, внешний вид");
  12.             dictionary.Add("гавана", "Гаванская сигарета");
  13.             dictionary.Add("гавот", "Старинный французский танец");
  14.             dictionary.Add("гаврик", "Жуликоватый человек, пройдоха");
  15.             dictionary.Add("гага", "Полярная морская нырковая утка с ценным пухом");
  16.  
  17.             Console.Write("Введите слово: ");
  18.             string userWord = Console.ReadLine();
  19.  
  20.             if (dictionary.ContainsKey(userWord))
  21.                 Console.WriteLine($"Значение: {dictionary[userWord]}");
  22.             else
  23.                 Console.WriteLine("слово отсутствует в словаре");
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement