コード例 #1
0
        public void Initialize()
        {
            GenStack stack = new Stack();
            calculator = new Calculator(stack);

            GenStack stackArray = new StackArray();
            calculatorWithStackOnArray = new Calculator(stackArray);
        }
コード例 #2
0
        static void Main(string[] args)
        {
            GenStack stack = new Stack();
            Calculator qwety = new Calculator(stack);
            stack.Push(2);
            stack.Push(3);
            stack.Push(4);
            qwety.Addition();
            int x = qwety.PopValue();

            GenStack stackOfArray = new StackArray();
            Calculator qwerty = new Calculator(stackOfArray);
            stackOfArray.Push(23);
            stackOfArray.Push(11);
            qwerty.Subtraction();
            int y = qwerty.PopValue();
        }