Advertisement
Rodunskiy

Untitled

Jun 4th, 2023
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.70 KB | None | 0 0
  1. class program
  2. {
  3.     static void Main(string[] args)
  4.     {
  5.         Dictionary<string, string> sports = new Dictionary<string, string>();
  6.         sports.Add("Футбол", "Football");
  7.         sports.Add("Баскетбол", "Basketball");
  8.         sports.Add("Хоккей", "Hockey");
  9.         sports.Add("Теннис", "Tennis");
  10.         sports.Add("Гольф", "Golf");
  11.  
  12.         Console.Write("Введите слово:");
  13.         string userInput = Console.ReadLine();
  14.  
  15.         if(sports.ContainsKey(userInput))
  16.         {
  17.             Console.WriteLine(sports[userInput]);
  18.         }
  19.         else
  20.         {
  21.             Console.WriteLine("Такого слова нет.");
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement