Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Runtime.CompilerServices;
- using System.Linq;
- namespace testing
- {
- class Program
- {
- static void Main(string[] args)
- {
- Dictionary<string, string> workers = new Dictionary<string, string>();
- bool quitRequest = false;
- while (quitRequest != true)
- {
- Console.WriteLine("Меню:\n1.Добавить досье\n2.Вывести все досье\n3.Удалить досье\n4.Выход");
- int input = Convert.ToInt32(Console.ReadLine());
- switch (input)
- {
- case 1:
- Console.WriteLine("Введите ФИО:");
- string newName = Console.ReadLine();
- Console.WriteLine("Введите должность:");
- string newPosition = Console.ReadLine();
- workers.Add(newName, newPosition);
- Console.Clear();
- break;
- case 2:
- int i = 1;
- foreach (var item in workers)
- {
- Console.Write(i + " " + item.Key + " " + item.Value + " ");
- i++;
- }
- Console.ReadKey();
- Console.Clear();
- break;
- case 3:
- Console.WriteLine("Введи ФИО удаляемого досье - ");
- string fileToRemove = Console.ReadLine();
- workers.Remove(fileToRemove);
- Console.Clear();
- break;
- case 4:
- quitRequest = true;
- Console.Clear();
- Console.WriteLine("Завершение работы программы...");
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement