#include #include using namespace std; const int MAX_STOP=4; //定义停车场最大停车数 const int MAX_PLATE=10; //定义车牌号最大长度 //数据结构定义 //定义存储汽车信息的结构体 typedef struct { char license_plate[MAX_PLATE];//汽车牌照号码,定义为一个字符指针类型 char state; //汽车当前状态,字符 p 表示停放在停车位上,字符 s 表示停放在便道上,每辆车的初始状态用字符 i 来进行表示 }CAR; //定义模拟停车场的栈结构 typedef struct { CAR STOP[MAX_STOP]; //汽车信息的存储空间 int top; //用来指示栈顶位置的静态指针 }SeqStack; //定义模拟便道的队列结构 typedef struct node { CAR WAIT; //汽车信息的存储空问 struct node *next; //用来指示队列位置的动态指针 }QNode; //链队列节点的类型 //定义链队列的收尾指针 typedef struct { QNode *front,*rear; }LQueue; //将头尾指针封装在一起的链队 //函数声明 int Empty_LQueue(LQueue *q); //判队空 int LeaveCheck(SeqStack parking,char *license_plate); //检查离开的车是否在停车场中 int QueueLength(LQueue *q); //判队长度 int Out_LQueue(LQueue *&sidewalk,char *license_plate); //出队操作 int StackEmpty(SeqStack par