#include<stdio.h>
#include<stdlib.h>
#include<stack>
#include<iostream>
#include<string.h>
#define max_stop 5 //停车道最多停车20
#define max_pave 100 //便道最多停车100
using namespace std;
//结构体定义
typedef struct { //汽车信息
char license_plate[20]; // 汽车牌照号码
char state; //汽车当前状态:
}CAR;
typedef struct { //栈1 实现 停车道
CAR STOP[max_stop];
int top;
}STOPPING;
typedef struct { //队列 实现 便道
CAR PAVE[max_pave];
int front,rear;
}PAVEMENT;
typedef struct { //栈2 实现 辅助位置
CAR BUFFER[max_stop];
int top;
}BUFFER;
//函数
void menu();
PAVEMENT *init_pavement(); //初始化“便道队列”
BUFFER *init_buff(); //初始化“辅助栈”
CAR* popStack1(STOPPING* stop,CAR* car);
//void carposition(STOPPING* stop,char license_plate[10]); //比较是否有这辆车,有则输出位置,无则显示无该车辆信息;
int topStack1(STOPPING* stop);
int IsFull(STOPPING* stack);
int pushStack1(STOPPING* stop,CAR* car);
bool pushStack2(BUFFER* buffer,CAR* car);
CAR* popStack2(BUFFER* buffer,CAR* car);
bool addQueue(PAVEMENT* pavement,CAR* car);
CAR* deleteQueue(PAVEMENT* pavement);
void member_car(PAVEMENT* pavement); //显示队列车辆数,直接输出
/复合函数
int car_come(STOPPING* stop,PAVEMENT* pavement,CAR* car);//驶入车,正常停车返回1,进入便道等待返回2,失败返回0
int car_leave(STOPPING* stop,BUFFER* buffer,char* license,CAR* car,PAVEMENT* pavement);
int IsInStop(STOPPING* stop,char* license);
STOPPING *init_stopping();
/
//
int main(void){
menu();
int n;int x=0;
STOPPING* stop=init_stopping();
PAVEMENT* pavement=init_pavement();
BUFFER* buffer=init_buff();
CAR* car=(CAR* )malloc(sizeof(CAR));
scanf("%d",&n);
while(n>=1&&n<=5){
switch(n){
case 1:
x=5-stop->top-1;
printf("停车道还有 %d 个车位\n\n",x);
case 2:
x=pavement->rear-pavement->front;