Created
April 19, 2024 19:49
-
-
Save kyzalex/81c135f0a67bc28c455b79fd80c226f0 to your computer and use it in GitHub Desktop.
Толковый словарь ver.2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal class Program | |
{ | |
static void Main(string[] args) | |
{ | |
while (true) | |
{ | |
Dictionary<string, string> dictionary = new Dictionary<string, string>(); | |
dictionary.Add("кукуруза", "культурное растение семейства злаков"); | |
dictionary.Add("картофель", "вид многолетних клубненосных травянистых растений из рода Паслён"); | |
dictionary.Add("свекла", "Корнеплод, растение с толстыми корнями, которые богаты органическими веществами"); | |
Console.Write("Ведите слово :"); | |
string word = Console.ReadLine(); | |
foreach (var keyValuePair in dictionary) | |
{ | |
if (keyValuePair.Key == word) | |
{ | |
Console.WriteLine($"значение слова - {keyValuePair.Key} это - {keyValuePair.Value} "); | |
} | |
else | |
{ | |
Console.WriteLine("Такого слова нет в словаре!"); | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment