如题,不用C#内置的堆栈类啊...

解决方案 »

  1.   

    static void Main(string[] args)
            {  
                Stack<int> s = new Stack<int>();
                int x = 0;
                for (int i = 0; i < 10; i++)
                {
                  s.Push(i);
                  x = s.Pop();
                  Console.WriteLine(x.ToString());
                }
                
                
                System.Threading.Thread.Sleep(5000);
                s = null;
            }