Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            IntStack stack = new IntStack(4);

            stack.Push("5");
            stack.Push("4");
            stack.Push("3");
            stack.Push("+");
            stack.Pop();
            //stack.Pop();
            //stack.Clear();
            if (stack.Contains("4"))
            {
                Console.WriteLine("Found X");
            }
            else
            {
                Console.WriteLine("Not found X");
            }
            //stack.Pop();
            stack.Xuat();
            MyExpression n = new MyExpression("1+18+ 2* 9+   5");

            n.Xuat();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Random   random = new Random();
            IntStack stack  = new IntStack();

            while (!stack.IsFull())
            {
                stack.Push(random.Next(100));
            }
            while (!stack.IsEmpty())
            {
                Console.WriteLine(stack.Pop());
            }
            System.Console.ReadKey();
        }