예제 #1
0
        public static void Add()
        {
            Console.WriteLine("\nВведiть данi:");

            string str = Console.ReadLine();

            string[] elements = str.Split(" ", StringSplitOptions.RemoveEmptyEntries);

            PutKey.P(elements, true);

            PutKey.Key();
        }
예제 #2
0
        public static void Key()
        {
            PutKey.P(PutKey.Read(), false);

            Console.WriteLine("Додавання записiв: +");
            Console.WriteLine("Редагування записiв: E");
            Console.WriteLine("Знищення записiв: R");
            Console.WriteLine("Виведення записiв: Enter");
            Console.WriteLine("Пошук днiв з мiнiмальною к-стю доступних дорiжок: K");
            Console.WriteLine("Середня к-сть вiдвiдувань в день за перiод: D ");
            Console.WriteLine("К-сть днiв, коли було доступно не менше зазначеної к-стi дорiжок: B ");
            Console.WriteLine("Вихiд: Esc");
            int[] num = new int[Program.all.Length];
            for (int i = 0; i < Program.all.Length; i++)
            {
                Program.all[i].Number = num[i];
            }

            switch (Console.ReadKey().Key)
            {
            case ConsoleKey.B:
                Pool.Find();
                break;

            case ConsoleKey.D:
                Console.WriteLine(Program.all[0].Average(num));
                break;

            case ConsoleKey.K:
                Pool.Min();
                break;

            case ConsoleKey.OemPlus:
                Pool.Add();
                break;

            case ConsoleKey.Enter:
                Pool.Write(Program.all);
                break;

            case ConsoleKey.Escape:
                return;

            case ConsoleKey.E:
                Pool.Edit();
                break;

            case ConsoleKey.R:
                Pool.Remove();
                break;
            }
        }