Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace dictionary
- {
- class Program
- {
- static void Main(string[] args)
- {
- Dictionary<string, string> dictionary = new Dictionary<string, string>();
- dictionary.Add("Привет", "Hello");
- dictionary.Add("Пока", "Bye");
- dictionary.Add("Да", "Yes");
- dictionary.Add("Нет", "No");
- Console.WriteLine("Введите слово: ");
- string userInput = Console.ReadLine();
- if (dictionary.ContainsKey(userInput))
- {
- Console.WriteLine(dictionary[userInput]);
- }
- else
- Console.WriteLine("Данного слова нет в словаре");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement