⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 waitingqueue.h

📁 模拟银行(也可以其他类似)一天的营运光顾情况。
💻 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 + -