コード例 #1
0
        static void Main(string[] args)
        {
            Expression cExp        = new Expression();
            Stack      scStack     = new Stack();
            string     inputString = cExp.GetUserInput();

            cExp.EvaluateExpression(inputString);
            int result = cExp.calculate(cExp.terms, cExp.ops);

            scStack.lastqAccess = inputString;
            scStack.lastAccess  = result.ToString();
            scStack.pushStack();
            scStack.peekStack();
            string test = scStack.lastqAccess;

            Console.WriteLine("Last Question pop = " + test);
            test = scStack.lastAccess;
            Console.WriteLine("Last Answer pop = " + test);
            Console.ReadKey();
        }