Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace Ijunior
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- Dictionary<string, string> countriesCapitals = new Dictionary<string, string>();
- countriesCapitals.Add("Нидерланды", "Амстердам");
- countriesCapitals.Add("Сербия", "Белград");
- countriesCapitals.Add("Венгрия", "Будапешт");
- countriesCapitals.Add("Великобритания", "Лондон");
- countriesCapitals.Add("Польша", "Варшава");
- countriesCapitals.Add("Испания", "Мадрид");
- Console.Write("Введите страну Европы: ");
- string userInput = Console.ReadLine();
- if (countriesCapitals.ContainsKey(userInput))
- {
- Console.WriteLine($"Страна - {userInput}, Столица - {countriesCapitals[userInput]}");
- }
- else
- {
- Console.WriteLine("Такой страны в списке нет");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment