#include
#include
#include
int cnt=0; //当日客流量
int sum=0; //当日客户排队总时间
typedef struct pnode{
int number;
int cometime;
int leavetime;
struct pnode *next;
}*person;
typedef struct node{
person front;
person rear;
int length;
}linkqueue;
linkqueue q[5];
int number,time;
int flag=1;
void initqueue(linkqueue &q){
q.front=q.rear=(person)malloc(sizeof(pnode));
if(!q.front||!q.rear)
exit(0);
q.front->next=NULL;
q.length=0;
}
void enterqueue(linkqueue &q,int number,int time){
person p;
p=(person)malloc(sizeof(person));
if(!p) exit(0);
q.length++;
p->number=number;
p->cometime=time;
// sum+=p->finishtime; //统计每个人的排队时长
p->next=NULL;
q.rear->next=p;
q.rear=p;
}
void popqueue(linkqueue &q){
person p;
if(q.front==q.rear){
return ;
}
p=q.front->next;
<