?? 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 + -