#include <iostream>
#include <stdlib.h>
#include <malloc.h>
#include <string.h>
#define OK 1
#define ERROR 0
#define OVERFLOW 0
#define STACK_INIT_SIZE 100
#define STACKINCREMENT 10
using namespace std;
typedef struct{
int x;
int y;
}PosType;
typedef struct{
int ord;
PosType seat;
int di;
}SElemType;
typedef struct{
SElemType * base;
SElemType * top;
int stacksize;
}SqStack;
void InitStack(SqStack &s)
{
s.base=(SElemType*)malloc(STACK_INIT_SIZE*sizeof(SElemType));
if(!s.base) exit(-1);
s.top=s.base;
s.stacksize=STACK_INIT_SIZE;
}
int StackEmpty( SqStack &s){
if (s.top==s.base)
return OK;
else
return ERROR;
}
void Push(SqStack &s,SElemType e){
*s.top++=e;
}
int Pop(SqStack &s,SElemType &e){
if (s.top==s.base) return ERROR;
e=*--s.top;
return OK;
}
int maze[9][8]={
{0,0,1,0,0,0,1,0},
{0,0,1,0,0,0,1,0},
{0,0,0,0,1,1,0,1},
{0,1,1,1,0,0,1,0},
{0,0,0,1,0,0,0,0},
{0,1,0,0,0,1,0,1},
{0,1,1,1,1,0,0,1},
{1,1,0,0,0,1,0,1},