main.cpp

来自「产生一个随机数」· C++ 代码 · 共 38 行

CPP
38
字号
//#include<assert.h>
#include"customerGroup.h"
#include"event.h"
#include"arriveEvent.h"
#include"simulation.h"
#include"storeSimulation.h"
#include"random.h"
#include <stdlib.h>
#include <stdio.h>
#include <time.h>



extern storeSimulation store(100);
void iceCreamStoreSimulation();
void main()
{
  //random   ran;
 iceCreamStoreSimulation();

}
void iceCreamStoreSimulation()
{
  random  ran;
  for(int time=0;time<120;time+=ran.between(2,5))
  
     {
        customerGroup* group=new customerGroup;
        assert(group!=0);
        event*ae=new arriveEvent(time,group);
        assert(ae!=0);
        store.scheduleEvent(ae);
		ran.refresh();
     }
  store.run();
  store.printProfits();
}        

⌨️ 快捷键说明

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