#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<iostream>
using namespace std;
#define STACK_INIT_SIZE 100
#define STACKINCREMENT 10
#define TURE 1
#define FALSE 0
#define OK 1
#define ERROR 0
#define INFEASIBLE -1
#define OVERFLOW -2
#define MAZE_X 20
#define MAZE_Y 20
typedef int Status;
typedef struct{
int x;
int y;
}PosType;//坐标位置
typedef struct{
int maze[MAZE_X][MAZE_Y];//迷宫地图
PosType size;//实际的迷宫长、宽
PosType start;//起点的坐标
PosType end;//重点的坐标
}MazeType;
typedef struct{
int ord; //通道块在路径上的序号;
PosType seat;
int di ;//通道块走向下一个通道块的方向
}SElemType;// 栈的元素类型
typedef struct{
SElemType* base;
SElemType* top;
int stacksize;
}SqStack;
int InitStack(SqStack &s){
//构造一个空栈
s.base = (SElemType*)malloc(STACK_INIT_SIZE*sizeof(SElemType));
if(!s.base) exit(OVERFLOW);
s.top=s.base;
s.stacksize=STACK_INIT_SIZE;
return OK;
}
int GetTop(SqStack s,SElemType &sElem){
//如果栈不空,用sElem返回s的栈