?? customergroup.cpp
字號:
#include"random.h"
#include"customerGroup.h"
random ran;//隨機數類ran
customerGroup::customerGroup():groupsize(ran.between(1,5))
{
}//隨機產生一個固定大小的顧客群
int customerGroup::orderSize()//購多少份
{
int scoops=0;
for(int i=0;i<groupsize;i++)
{
ran.refresh();
scoops+=(ran.between(1,3));//假定顧客群每個顧客點1到3份
}
return scoops;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -