simulator.cpp
来自「这是一个我的课后习题,要求编译一个酒店管理程序.做的不好~多多执教」· C++ 代码 · 共 31 行
CPP
31 行
#include <iostream.h>
#include <stdlib.h>
#include "Manager.h"
class Simulator{
public:
Simulator(){}
void doSimulation(int time, int rooms)
{
//as soon as i use loop, the problem is stuck!
Manager a;
a.initialize(rooms);
a.reserve(time,rooms);
a.cancel(rooms);
a.rooms_status();
a.end_status();
}
};
void main(void)
{
Simulator s;
int time_to_run;
int number_of_rooms;
cout << "Please input the time you wish to run(between 1 to 10):";
cin>>time_to_run;
cout << "Please input the total rooms number in your hotel(between 1 to 100): ";
cin>>number_of_rooms;
s.doSimulation(time_to_run, number_of_rooms);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?