sy5.cpp

来自「以队列和栈实现的仿真技术预测理发馆的经营状况」· C++ 代码 · 共 41 行

CPP
41
字号
#include<iostream.h>
#include<iomanip.h>
#include<stdlib.h>
#include<process.h>
#include<string.h>
#include "sy5.h"

void main()
{
    int t=0,u;
	cout<<"*****************预测理发馆的经营情况******************"<<endl;
	cout<<"-------------------------------------------------------"<<endl;
	cout<<"        >  ------ 1. 服务"<<"         >  ------ 2. 退出"<<endl;
	cout<<"*******************************************************"<<endl;
	H1: cout<<">>   请选择要执行的操作: "; 
    cin>>u;
    switch(u)
	{
	case 1:
		OpenForDay();
		break;
	case 2:
	 cout<<"退出 "<<endl;
	 exit(0);
	}
	while(!ListEmpty(ev))
	{
		DelFirst(ev,en);
		if(en.NType==0) CustomerArrived();
		else CustomerDeparture();
	}
	cout<<"顾客人数: "<<CustomerNum<<endl;
	cout<<"平均逗留时间: "<<setprecision(3)<<Totaltime/CustomerNum<<endl;
    cout<<"平均队长: "<<Totallength/CustomerNum<<endl; 
    cout<<"服务收费: "<<y<<endl; 
	t=(t1>=t2)?t1:t2;
	cout<<"关门后工作时间: "<<t-CloseTime<<endl;
    cout<<endl<<"<  --1.服务    "<<"2. 退出   >"<<endl;
    cout<<endl;
    goto H1;
}

⌨️ 快捷键说明

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