Пример #1
0
        static void Main()
        {
            do
            {
                Console.Clear();

                MyInt myInt = new MyInt(new int[] { 1, 2, 3, 4, 5 });
                foreach (var i in myInt)
                {
                    Console.Write(i + " ");
                }
                Console.WriteLine();

                Console.WriteLine("Press Esc to exit. Press any other key to continue.");
            } while (Console.ReadKey(true).Key != ConsoleKey.Escape);
        }
Пример #2
0
        static void Main(string[] args)
        {
            do
            {
                Console.Clear();

                int[] arr   = { 3, 4, 2, 6, 8, 4, 7, 8 };
                MyInt myInt = new MyInt(arr);
                foreach (var item in myInt)
                {
                    Console.Write(item + " ");
                }

                Console.WriteLine("Enter Esc to exit...");
            } while (Console.ReadKey().Key != ConsoleKey.Escape);
        }