Beispiel #1
0
        static void Main()

        {
            Stack1 s1 = new Stack1();

            s1.Push(1);

            s1.Push(2);

            s1.Push(3);

            Console.WriteLine(s1.Pop());

            Console.WriteLine(s1.Pop());

            Console.WriteLine(s1.Pop());



            Stack2 s2 = new Stack2();

            s2.Push("KOREA");

            s2.Push("대한민국");

            s2.Push("서울");

            Console.WriteLine(s2.Pop());

            Console.WriteLine(s2.Pop());

            Console.WriteLine(s2.Pop());



            Stack3 <string> s3 = new Stack3 <string>();

            s3.Push("KOREA");

            s3.Push("대한민국");

            s3.Push("서울");

            Console.WriteLine(s3.Pop());

            Console.WriteLine(s3.Pop());

            Console.WriteLine(s3.Pop());
        }
Beispiel #2
0
        static void Main()
        {
            Stack1 <int> s1 = new Stack1 <int>();

            s1.Push(1);
            s1.Push(2);
            s1.Push(3);
            Console.WriteLine(s1.Pop());
            Console.WriteLine(s1.Pop());
            Console.WriteLine(s1.Pop());

            Stack1 <string> s2 = new Stack1 <string>();

            s2.Push("KOREA");
            s2.Push("대한민국");
            s2.Push("서울");
            Console.WriteLine(s2.Pop());
            Console.WriteLine(s2.Pop());
            Console.WriteLine(s2.Pop());
        }