Skip to content

Instantly share code, notes, and snippets.

@Attosius
Created October 13, 2025 18:39
Show Gist options
  • Select an option

  • Save Attosius/e35292fbf5c96aeff5d1bc6584e0cd51 to your computer and use it in GitHub Desktop.

Select an option

Save Attosius/e35292fbf5c96aeff5d1bc6584e0cd51 to your computer and use it in GitHub Desktop.
ДЗ: Толковый словарь
using System;
using System.Collections.Generic;
namespace IJuniorTasks
{
internal class Program
{
static void Main(string[] args)
{
var explanatoryDictionary = FillDictionary();
Console.WriteLine("Введите слово для поиска:");
var userInput = Console.ReadLine();
if (explanatoryDictionary.TryGetValue(userInput.Trim().ToUpper(), out var description))
{
Console.WriteLine($"Значение слова {userInput}: {description}");
}
else
{
Console.WriteLine($"Значение слова {userInput} не найдено");
}
}
private static Dictionary<string, string> FillDictionary()
{
var explanatoryDictionary = new Dictionary<string, string>
{
["ВЕТОШЬ"] = "ветхая одежда, ветхие вещи; отходы текстильного производства",
["ЙЁВИК"] = "город и коммуна в Норвегии",
["ЩЁГОЛЬ"] = "тот, кто нарядно, изысканно одевается, кто любит наряжаться; франт"
};
return explanatoryDictionary;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment