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

📄 haircut.cpp

📁 java编程理发馆
💻 CPP
字号:
#include<iostream.h>
#include"linklist.h"
#include"queue.h"
#include"simulation.h"
#include"common.h"
void main()
{
	int t;
    cout<<"input the chairs' number:";
	cin>>CurrentChair;
	cout<<"input CloseTime:";
	cin>>CloseTime;
	cout<<endl;
	en.OccurTime=0;
	en.NType=0;
	InitList(ev);
	OrderInsert(ev,en);
	InitQueue(Q);
	while(ev.len!=0)
	{
		DelFirst(ev,en);
		if(en.NType==0) CustomerArrived();
		else CustomerDeparture();
	}
	cout<<"number of customer"<<CustomerNum<<endl;
	cout<<"Average time:"<<Totaltime/CustomerNum<<endl;
	cout<<"Average queuelength"<<Totallength/CustomerNum<<endl;
	t=(t1>=t2)?t1:t2;
	cout<<"Addition time"<<t-CloseTime<<endl;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -