Exemple #1
0
        } // end Main

        // creates a new set by reading numbers from the user
        private static IntegerSet InputSet()
        {
            IntegerSet temp = new IntegerSet();

            Console.Write("Enter number (-1 to end): ");
            int number = Convert.ToInt32(Console.ReadLine());

            while (number != -1)
            {
                temp.InsertElement(number);

                Console.Write("Enter number (-1 to end): ");
                number = Convert.ToInt32(Console.ReadLine());
            } // end while

            return(temp);
        }