예제 #1
0
 public void TestChar()
 {
     var stack = new Stack<char>();
     stack.Push('v');
     stack.Push('n');
     Assert.AreEqual('n', stack.Pop());
     Assert.AreEqual('v', stack.Pop());
 }
예제 #2
0
 static void Main(string[] args)
 {
     Stack stack = new Stack();
     for (int i = 1; i < 10; ++i)
     {
         stack.Push(i);
     }
     for (int i = 1; i < 10; ++i)
     {
         Console.WriteLine(stack.Pop());
     }
     Console.ReadKey();
 }
예제 #3
0
 public void Initialize()
 {
     stack = new Stack<int>();
 }
예제 #4
0
 public void Initialize()
 {
     stack = new Stack();
 }