kwest87

Untitled

Apr 20th, 2022
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.51 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.                         dossier.Add( Console.ReadLine(),Console.ReadLine());
  29.                         break;
  30.                     case "2":
  31.                         foreach(var names in dossier.Keys)
  32.                         {
  33.                             int indent =+ 1;
  34.                             Console.WriteLine(indent +" ) "+ names + " - " + dossier[names]);
  35.                         }
  36.                         break;
  37.                     case "3":
  38.                         dossier.Remove(Console.ReadLine());
  39.                         break;
  40.                     case "4":
  41.                         exit = true;
  42.                         break;
  43.                 }
  44.             }
  45.         }
  46.     }
  47. }
  48. [EndCode]
Advertisement
Add Comment
Please, Sign In to add comment