?? main.cpp
字號:
//main.cpp
#include"All.h"
int arrivetime[30] ;
void main()
{
cout << " *****************************************************" << endl ;
cout << " * 電梯模擬程序<Copyright.2007> *" << endl ;
cout << " * *" << endl ;
cout << " * ------ by naixue520 *" << endl ;
cout << " * 2007.9.9 *" << endl ;
cout << " *****************************************************" << endl ;
cout << endl << endl ;
cout << " 說明 " << endl << endl ;
cout << " 該電梯模擬程序是模擬兩層的電梯在一定的時間內(nèi),電梯的運(yùn)作過程,其中到達(dá)" << endl ;
cout << " 到達(dá)每層的人是隨機(jī)生成的,假設(shè)每隔5到20秒隨機(jī)生成一個人,而且每次電梯從一" << endl ;
cout << " 層到達(dá)另一層所需時間為5秒。 " << endl ;
cout << endl << endl ;
char begin ;
cout << "可以開始演示了嗎?(Y/N) " ;
cin >> begin ;
if( begin =='y'|| begin == 'Y' )
{
cout <<"現(xiàn)在請看下面的電梯程序演示過程.........." << endl << endl ;
Clock c ;
int nowtime = 0 ;
Person m ;
srand(time(0)) ;//隨機(jī)種子
for( int i = 0 ; nowtime < 150 ; i++ )
{
nowtime += ( 5 + rand() % 16 ) ;
arrivetime[i] = nowtime + c.gettime() ;
}
m.creatPerson() ;
}
cout << "\n\n------------------------------謝謝!歡迎多提建議!--------------------------------\n\n\n" ;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -