kwest87

Untitled

Apr 20th, 2022
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.62 KB | None | 0 0
  1. [StartCode]
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace ConsoleApp19
  9. {
  10.     internal class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             Dictionary<string, string> dossier = new Dictionary<string, string>();
  15.             bool exit = false;
  16.             string menuOption;
  17.  
  18.             while (exit == false)
  19.             {
  20.                 Console.WriteLine("        МЕНЮ");
  21.                 Console.WriteLine();
  22.                 Console.WriteLine("1 - Добавить досье.\n2 - Список досье.\n3 - Удалить досье.\n4 - Выход.");
  23.                 menuOption = Console.ReadLine();
  24.  
  25.                 switch (menuOption)
  26.                 {
  27.                     case "1":
  28.                         Console.WriteLine("Введите имя , затем должность :");
  29.                         dossier.Add( Console.ReadLine(),Console.ReadLine());
  30.                         break;
  31.                     case "2":
  32.                         foreach(var names in dossier.Keys)
  33.                         {
  34.                             Console.WriteLine(names + " - " + dossier[names]);
  35.                         }
  36.                         break;
  37.                     case "3":
  38.                         Console.WriteLine("Укажите имя");
  39.                         dossier.Remove(Console.ReadLine());
  40.                         break;
  41.                     case "4":
  42.                         exit = true;
  43.                         break;
  44.                 }
  45.             }
  46.         }
  47.     }
  48. }
  49. [EndCode]
Advertisement
Add Comment
Please, Sign In to add comment