haircut.cpp

来自「理发馆的排队模拟」· C++ 代码 · 共 24 行

CPP
24
字号
#include "common.h"
#include "Linklist.h"
#include "Queue.h"
#include "simulation.h"

void main()
{
    int t=0;
	OpenForDay();
	while(!ListEmpty(ev))
	{
		DelFirst(ev,en);
		if(en.NType==0) CustomerArrived();
		else CustomerDeparture();
	}
	cout<<"Number of customer "<<CustomerNum<<endl;
	cout<<"Average time "<<setprecision(3)<<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 + =
减小字号Ctrl + -
显示快捷键?