Пример #1
0
        static void Main(string[] args)
        {
            ArithmeticProgression p = new ArithmeticProgression
                                          (5, 5, 10);

            foreach (var a in p)
            {
                Console.WriteLine(a);
            }

            Console.ReadKey();
        }
Пример #2
0
        static void Main(string[] args)
        {
            do
            {
                Console.Clear();

                ArithmeticProgression arithmeticProgression = new ArithmeticProgression(5, 5, 10);
                foreach (var item in arithmeticProgression)
                {
                    Console.Write(item + " ");
                }

                Console.WriteLine("Enter Esc to exit...");
            } while (Console.ReadKey().Key != ConsoleKey.Escape);
        }
Пример #3
0
        static void Main()
        {
            do
            {
                Console.Clear();

                ArithmeticProgression progression = new ArithmeticProgression(1, 2, 10);

                foreach (var i in progression)
                {
                    Console.Write(i + " ");
                }
                Console.WriteLine();

                Console.WriteLine("Press Esc to exit. Press any other key to continue.");
            } while (Console.ReadKey(true).Key != ConsoleKey.Escape);
        }