Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- using System.Collections.Generic;
- namespace ConsoleApp3
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- Dictionary<string, string> dossiers = new Dictionary<string, string>();
- bool isRun = true;
- string userInput;
- while (isRun)
- {
- userInput = Console.ReadLine();
- switch (userInput)
- {
- case "1":
- dossiers.Add(Console.ReadLine(), Console.ReadLine());
- break;
- case "2":
- string tempKey = Console.ReadLine();
- if (dossiers.ContainsKey(tempKey))
- {
- dossiers.Remove(tempKey);
- }
- else
- {
- Console.WriteLine("Досье не найденно");
- }
- break;
- case "3":
- if (dossiers.Count > 0)
- {
- foreach (var elemnt in dossiers)
- {
- Console.WriteLine($"{elemnt.Key} - {elemnt.Value}");
- }
- }
- else
- {
- Console.WriteLine("Список досье пуст.");
- }
- break;
- case "4":
- isRun = false;
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement