细微漫步,处处留痕,你的世界,我的眼光.何年何月永远不变.

发布新日志

  • 这个程序有什么BUG??

    2008-05-06 20:43:33


    namespace MyStack
    {
        public class MyStack
        {
            private int nextIndex;
            private string[] elements(元素);
            public static void Main(string[] args)
            {
            }
            public MyStack()
            {
                elements = new string[100];
                nextIndex = 0;
            }
            public void Push(string element)
            {
                elements[nextIndex++] = element;
            }
            public string Pop()
            {
                return elements[--nextIndex];
            }
            public void Delete(int n)
            {
                nextIndex = nextIndex - n;
            }
            public string Top()
            {
                return elements[nextIndex-1];
            }
            public int Size()
            {
                return this.nextIndex;
            }
           }
          }
       

数据统计

  • 访问量: 1241
  • 日志数: 2
  • 文件数: 3
  • 建立时间: 2008-04-09
  • 更新时间: 2008-05-06

RSS订阅

Open Toolbar