注册 登录
编程论坛 C++教室

调试的时候显示 系统找不到指定的路径 求指导!!

hicom4235 发布于 2012-10-06 16:49, 325 次点击
#include <iostream>
using namespace std;


class seqStack
{
    private:  
          int *elem;
          int top_p;
    public:
        seqStack(int initSize=10)
         {
             elem=new int[initSzie];
             top_p=-1;
        }
        ~seqStack() [delete[] elem;]

        bool isEmpty() const {return top_p==-1;}
        void push(const int &r)
        {
            elem[++top_p]=r;
        }

        int pop()
        {return elem[top_p--];}
};

int  Ackerman(int m,int n)
{   seqStack r;
    r.push(m);
    r.push(n);
    while (true)
    {  n=r.pop();
       if(r.isEmpty()==1) return n;
       m=r.pop();
       if(m=0) r.push(n+1);
       if(m!=0||n=0)
       {  r.push(m-1);
          r.push(1);
       }
       if (m!=0||n!=0)
       {  r.push(m-1);
          r.push(m);
          r.push(n-1)
       }
    }
}
0 回复
1