示例#1
0
        static void Main(string[] args)
        {
            MyStack <int> myStack = new MyStack <int>(1);

            Console.WriteLine(myStack.PopItem()._value);

            MyStack <int> myStack2 = new MyStack <int>(1);

            myStack2.PushItem(2);
            myStack2.PushItem(3);
            foreach (var x in myStack2)
            {
                Console.WriteLine(x);
            }
        }
示例#2
0
 public MyStackEnumerator(MyStack <T> stack)
 {
     this.stack = stack;
 }