Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [StartCode]
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp16
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- Dictionary<string, string> peoples = new Dictionary<string, string>();
- peoples.Add("Алекс", "23 года");
- peoples.Add("Антон", "22 года");
- peoples.Add("Семён", "32 года");
- peoples.Add("Андрей", "20 лет");
- peoples.Add("Максим", "36 лет");
- Showage(peoples);
- }
- static void Showage(Dictionary<string,string>peoples)
- {
- if (peoples.ContainsKey(Console.ReadLine()))
- Console.WriteLine(peoples["Алекс"]);
- else
- Console.WriteLine("Такого нету.");
- }
- }
- }
- [endCode]
Advertisement
Add Comment
Please, Sign In to add comment