예제 #1
0
        /// <summary>
        /// Read from the console untill an invalid number is entered.
        /// </summary>
        /// <param name="sampleStack">ICustomList to store the numbers.</param>
        static void ConsoleReader(ICustomStack<int> sampleStack)
        {
            int input = 0;
            bool toProceed = true;

            while (toProceed)
            {
                toProceed = int.TryParse(Console.ReadLine(), out input);
                if (toProceed)
                {
                    sampleStack.Push(input);
                }
            }
        }
예제 #2
0
 public Engine()
 {
     this.stack = new CustomStack <string>();
 }