#include "stdio.h"
#include "string.h"
#include "stdlib.h"
#include "time.h"
#define null 0
#define Maxsize 4
void clear(char a[])
{
int i,counta;
counta=strlen(a);
for(i=0;i
}
struct car //定义车的结构体
{
char message[10];
char num[10];
char intime[10];
char outtime[10];
int expense;
int delay;
int position;
};
typedef struct //*****************************************栈*********************************
{
struct car d[Maxsize];
int top;
}SeqStack;
void init(SeqStack *s) //初始化栈
{
s->top=-1;
}
int isemptystack(SeqStack *s) //判断栈是否为空
{
if(s->top==-1)
return 1;
else
return 0;
}
int isfullstack(SeqStack *s) //判断栈是否为满
{
if(s->top==Maxsize-1)
return 1;
else
return 0;
}
void push(SeqStack *s,struct car x) // 进栈
{
if(!isfullstack(s))
{
s->top++;
s->d[s->top]=x;
}
}
struct car pop(SeqStack *s) //,取栈顶元素,出栈
{
car x;
if(s->top!=-1)
{
x=s->d[s->top];
s->top--;
return x;
}
}
car gettop(SeqStack *s) //取栈顶元素
{
car x;
if(s->top!=-1)
{
x=s->d[s->top];
return x;
}
}
//*************************************************栈*************************************
//*****************************************队列链表**************************************
typedef struct slnode //定义链队列的接点性质
{
struct car data