题目描述
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define TRUE 1
#define FALSE 0
#define N 2
typedef struct
{
char num[20];//车牌照号码
int arriveh,arrivem,arrives;//到达的时分秒
int leaveh,leavem,leaves;//离开的时分秒
}CAR;
typedef struct
{
CAR car[N];
int top;
}PARKING_STACK;
typedef struct
{
CAR car[N];
int front;
int rear;
}SIDEWALK_QUEUE;
void InitStack(PARKING_STACK *stack)
{
stack->top=-1;
}
void InitQueue(SIDEWALK_QUEUE *queue)
{
queue->front=queue->rear=0;
}
int PushStack(PARKING_STACK *stack,CAR car)
{
if(stack->top==N)
return FALSE;
stack->car[++stack->top]=car;
return TRUE;
}
CAR PopStack(PARKING_S