- 32
- 0
- 约6.16千字
- 约 9页
- 2019-11-01 发布于湖北
- 举报
//停车场管理系统
#includestdio.h
#includestdlib.h
#define OVERFLOW 0
#define ERROR 0
#define OK 1
#define STACKSIZE 2 //车库容量
//时间节点
typedef struct time{
int hour;
int min;
}Time;
//车辆信息
typedef struct{
char CarNum;
float time;
int pos_a; //车在停车场中的位置
int pos_b; //车在便道上的位置
int flag;
}Car,Car2;
//车库信息 (顺序栈)
typedef struct{
Car *top;
Car *base;
int stacksize;
}SqStack;
//初始化
int InitStack(SqStack S){
S.base=new Car[STACKSIZE];
if(!S.base) exit(OVERFLOW);
S.top=S.base;
S.stacksize=STACKSIZE;
return OK;
}
//判空
int StackEmpty(SqStack S){
if(S.top==S.base) return OK;
原创力文档

文档评论(0)