请帮我看看这个程序有什么错误

来源:百度知道 编辑:UC知道 时间:2024/05/06 04:28:36
#include<iostream>
using namespace std;
class point //迷宫中的节点
{
public:
int x;
int y;
int can; //标志节点是否可以通过,1为可以通过,0为不能通过
int ever; //标志节点是否走过,1表示走过,0表示未走过
};

class stack //定义栈
{
private:
point *base;
point *top;
public:
stack();
void push(point);
point pop();
void show();
};
stack::stack()
{
base=new point[1000];
top=base;
}
void stack::push(point p)
{
if(base==top)*base=p;
else *top=p;
top++;
}
point stack::pop()
{
top--;
return(*top);
}
void stack::show()
{
while(base!=top)
{
cout<<base->x<<" "<<base->y<<endl;
base++;
}
}

class migong //定义迷宫
{
private:
point mg[100][100];
int length;
int width;
stack st;
public:
migon

#include<iostream>
using namespace std;
class point //迷宫中的节点
{
public:
int x;
int y;
int can; //标志节点是否可以通过,1为可以通过,0为不能通过
int ever; //标志节点是否走过,1表示走过,0表示未走过
};

class stack //定义栈
{
private:
point *base;
point *top;
public:
stack();
void push(point);
point pop();
void show();
};
stack::stack()
{
base=new point[1000];
top=base;
}
void stack::push(point p)
{
if(base==top)*base=p;
else *top=p;
top++;
}
point stack::pop()
{
top--;
return(*top);
}
void stack::show()
{
while(base!=top)
{
cout<<base->x<<" "<<base->y<<endl;
base++;
}
}

class migong //定义迷宫
{
private:
point mg[100][100];
int length;
int width;
stack st;
public: