示例#1
0
        public static int MenuForRagArrays()
        {
            Console.ForegroundColor = ConsoleColor.White;
            int secondChoice;

            Console.WriteLine("1 - Пересоздать массив");
            Console.WriteLine("2 - Напечатать массив");
            Console.WriteLine("3 - Удалить все строки, содержащие нули");
            Console.WriteLine("4 - Назад");
            do
            {
                secondChoice = Easy.EnterInt();
                if ((secondChoice < 1) || (secondChoice > 4))
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("\nТакого номера команды нет, повторите ввод");
                    Console.ForegroundColor = ConsoleColor.White;
                }
            } while ((secondChoice < 1) || (secondChoice > 4));
            Console.WriteLine();
            return(secondChoice);
        }
示例#2
0
        public static int MainMenu()
        {
            int firstChoice;

            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine("1 - Работа с одномерными массивами");
            Console.WriteLine("2 - Работа с двумерными массивами");
            Console.WriteLine("3 - Работа с рваными массивами");
            Console.WriteLine("4 - Выход");
            Console.WriteLine("\n Введите номер команды:");
            do
            {
                firstChoice = Easy.EnterInt();
                if ((firstChoice < 1) || (firstChoice > 4))
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("\nТакого номера команды нет, повторите ввод");
                    Console.ForegroundColor = ConsoleColor.White;
                }
            } while ((firstChoice < 1) || (firstChoice > 4));
            Console.WriteLine();
            return(firstChoice);
        }