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

📄 main.cpp

📁 数据结构
💻 CPP
字号:
#include"event.h"
#include"random.h"
#include"arriveEvent.h"
#include"customergroup.h"
#include"storeSimulation.h"

#include<assert.h>
#include<iostream.h>

const int seatnum=10;
const int hour=8;


storeSimulation store(seatnum);
void iceCreamStoreSimulation();


void main()
{
	cout<<"       "<<"冰淇淋店"<<endl;
	cout<<seatnum<<"个座位,营业"<<hour<<"小时"<<endl;
	
	iceCreamStoreSimulation();
}

void iceCreamStoreSimulation()
{  	
    for(unsigned int time=0;time<(hour*60);time+=randgen.between(1,10))
    {
		customerGroup*group=new customerGroup;
		
		assert(group!=0);
		event* ae=new arriveEvent(time,group);
		assert(ae!=0);
		store.scheduleEvent(ae);
    }
    store.run();
    store.printProfits();
}

⌨️ 快捷键说明

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