main.~cpp

来自「产生一个随机数」· ~CPP 代码 · 共 30 行

~CPP
30
字号
#include<assert.h>
#include"customerGroup.h"
#include"event.h"
#include"arriveEvent.h"
#include"simulation.h"
#include"storeSimulation.h"
#include"random.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);
     }
  store.run();
  store.printProfits();
}        

⌨️ 快捷键说明

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