📄 main.cpp
字号:
/*
此程序原来在vc6里面编程调试通过,
今天(2007-04-26)再次修改,在vs2005里面编译通过,
今天做如下修改:
去掉了全局变量bfloors,因为有很多朋友在vc6里面编译总是提示警告,因此将全局变量改为类的成员变量。
*/
#include "DataInfo.h"
#include "Building.h"
#define JUDGE bf
int main()
{
int bfloors;//建筑的楼层数目;
Building *pb;
srand((int)time(NULL));
cout<<"##***************************************************************************##"<<endl
<<"# This is Model of the elevator #"<<endl
<<"# This process is simulated elevator.The elevator have stopped at the #"<<endl
<<"# beginning of each of the bottom floor (Layer 0) at Every the begining time.#"<<endl
<<"# Following the operator operate. #"<<endl
<<"# Now,you are the operator! #"<<endl
<<"# You can input ENTER to have the floor random create people.After the #"<<endl
<<"# floor was had some people,You can choose to operate,like ENTER to create #"<<endl
<<"# man,SPACE to have the elevator runs to next. #"<<endl
<<"# You may choose SPACE to have the elevator runs to next. This has re_ #"<<endl
<<"# quired the elevator operation to the next level, when the system was out #"<<endl
<<"# for detection of this story,or to come, then the elevator stopped and open #"<<endl
<<"# the elevator door,waiting,End of people out there who are waiting out, the #"<<endl
<<"# others to come and wait he or to choose witch floor to go. of course, this #"<<endl
<<"# is not to allow overloading.then to close door,and run again! #"<<endl
<<"# Finally you can choose ESC to exit this simulation! #"<<endl
<<"# Thank you! #"<<endl
<<"# #"<<endl
<<"# By Wang Jianyou #"<<endl
<<"# February 26th 2007 #"<<endl
<<"# #"<<endl
<<"# #"<<endl
<<"# key: #"<<endl
<<"# ENTER---------------Create people #"<<endl
<<"# SPACE---------------The elevator runs to next floor #"<<endl
<<"# h / H---------------Help Menu #"<<endl
<<"# ESC-----------------Exit the Simulation #"<<endl
<<"# #"<<endl
<<"#*****************************************************************************#"<<endl;
cout<<"Plese enter floor number of the building:";
do{
cin>>bfloors;
}while(bfloors<0 || bfloors>100);
pb=new Building(bfloors);
pb->SysRun();
delete pb;
cout<<"##***************************************************************************##"<<endl
<<"# #"<<endl
<<"# writer: Wang Jianyou (汪建友) #"<<endl
<<"# E-mail: neuwjyou@163.com #"<<endl
<<"# Websit: http://hi.baidu.com/neuwjyou #"<<endl
<<"# Copyright:Wang Jianyou #"<<endl
<<"# #"<<endl
<<"#*****************************************************************************#"<<endl;
return 1;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -