Esempio n. 1
0
        static void Main(string[] args)
        {
            stack One = new stack(3);

            One.push(1);
            One.push(2);
            One.push(3);
            One.push(4);
            One.print();
            One.pop();
            One.pop();
            One.pop();
            One.pop();
            One.print();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            stack s = new stack(5);

            s.push(10);
            s.pop(); s.print();
            s.push(1);
            s.push(2);
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            stack test = new stack(10);

            test.push(5);
            test.push(6);
            test.pop();
            test.peek();
            stack other = new Stack.stack(5);

            other.push(1);
            other.push(2);
            other.push(500);
            Console.WriteLine(other.pop() + " has been popped");
            other.push(3);
            other.push(4);
            other.push(5);
            other.push(6);
            other.peek();
            Console.ReadLine();
        }