📄 waitingqueue.h
字号:
#include<iostream>
using namespace std;
class WaitingCustomerQueue:public QUeue<CUstomerType>
{
protected:
int lefttottime;
public:
void UpdateWatingQueue();//每隔一个单位时间,队伍中等待的顾客的waitingtime就加1
int LeftTotWaitingTime();
};
void WaitingCustomerQueue::UpdateWatingQueue()
{
QueueLen();
int i,count;
for(count=0,i=front+1;count<len;i++,count++)
{
if(i==MAXSIZE)i=i-MAXSIZE;
room[i].IncrementWaitingTime();
}
}
int WaitingCustomerQueue::LeftTotWaitingTime()
{
int i,count;
QueueLen();
lefttottime=0;
for(count=0,i=front+1;count<len;i++,count++)
{
if(i==MAXSIZE)i=i-MAXSIZE;
lefttottime+=room[i].GetWaitingTime();
}
return lefttottime;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -