亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? 3.cpp

?? 《數(shù)據(jù)結(jié)構(gòu)與程序設(shè)計(jì)》書(shū)本所有源代碼!!!!
?? CPP
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
   int num_land_accepted;        //  number of planes queued to land   int num_takeoff_accepted;     //  number of planes queued to take off   int num_land_refused;         //  number of landing planes refused   int num_takeoff_refused;      //  number of departing planes refused   int land_wait;                //  total time of planes waiting to land   int takeoff_wait;             //  total time of planes waiting to take off   int idle_time;                //  total time runway is idle};enum Plane_status {null, arriving, departing};class Plane {public:   Plane();   Plane(int flt, int time, Plane_status status);   void refuse() const;   void land(int time) const;   void fly(int time) const;   int started() const;private:   int flt_num;   int clock_start;   Plane_status state;};void initialize(int &end_time, int &queue_limit,                double &arrival_rate, double &departure_rate)/*Pre:  The user specifies the number of time units in the simulation,      the maximal queue sizes permitted,      and the expected arrival and departure rates for the airport.Post: The program prints instructions and initializes the parameters      end_time, queue_limit, arrival_rate, and departure_rate to      the specified values.Uses: utility function user_says_yes*/{   cout << "This program simulates an airport with only one runway." << endl        << "One plane can land or depart in each unit of time." << endl;   cout << "Up to what number of planes can be waiting to land "        << "or take off at any time? " << flush;   cin  >> queue_limit;   cout << "How many units of time will the simulation run?" << flush;   cin  >> end_time;   bool acceptable;   do {      cout << "Expected number of arrivals per unit time?" << flush;      cin  >> arrival_rate;      cout << "Expected number of departures per unit time?" << flush;      cin  >> departure_rate;      if (arrival_rate < 0.0 || departure_rate < 0.0)         cerr << "These rates must be nonnegative." << endl;      else         acceptable = true;      if (acceptable && arrival_rate + departure_rate > 1.0)         cerr << "Safety Warning: This airport will become saturated. " << endl;   } while (!acceptable);}Runway::Runway(int limit)/*Post:  The Runway data members are initialized to record no       prior Runway use and to record the limit on queue sizes.*/{   queue_limit = limit;   num_land_requests = num_takeoff_requests = 0;   num_landings = num_takeoffs = 0;   num_land_refused = num_takeoff_refused = 0;   num_land_accepted = num_takeoff_accepted = 0;   land_wait = takeoff_wait = idle_time = 0;}Error_code Runway::can_land(const Plane &current)/*Post:  If possible, the Plane current is added to the       landing Queue; otherwise, an Error_code of overflow is       returned. The Runway statistics are updated.Uses:  class Extended_queue.*/{   Error_code result;   if (landing.size() < queue_limit)      result = landing.append(current);   else      result = fail;   num_land_requests++;   if (result != success)      num_land_refused++;   else      num_land_accepted++;   return result;}Error_code Runway::can_depart(const Plane &current)/*Post:  If possible, the Plane current is added to the       takeoff Queue; otherwise, an Error_code of overflow is       returned. The Runway statistics are updated.Uses:  class Extended_queue.*/{   Error_code result;   if (takeoff.size() < queue_limit)      result = takeoff.append(current);   else      result = fail;   num_takeoff_requests++;   if (result != success)      num_takeoff_refused++;   else      num_takeoff_accepted++;   return result;}Runway_activity Runway::activity(int time, Plane &moving)/*Post:  If the landing Queue has entries, its front       Plane is copied to the parameter moving       and a result  land is returned. Otherwise,       if the takeoff Queue has entries, its front       Plane is copied to the parameter moving       and a result  takeoff is returned. Otherwise,       idle is returned. Runway statistics are updated.Uses:  class Extended_queue.*/{   Runway_activity in_progress;   if (!landing.empty()) {      landing.retrieve(moving);      land_wait += time - moving.started();      num_landings++;      in_progress = land;      landing.serve();   }   else if (!takeoff.empty()) {      takeoff.retrieve(moving);      takeoff_wait += time - moving.started();      num_takeoffs++;      in_progress = takeoff;      takeoff.serve();   }   else {      idle_time++;      in_progress = idle;   }   return in_progress;}Plane::Plane(int flt, int time, Plane_status status)/*Post:  The Plane data members flt_num, clock_start,       and state are set to the values of the parameters flt,       time and status, respectively.*/{   flt_num = flt;   clock_start = time;   state = status;   cout << "Plane number " << flt << " ready to ";   if (status == arriving)      cout << "land." << endl;   else      cout << "take off." << endl;}Plane::Plane()/*Post:  The Plane data members flt_num, clock_start,       state are set to illegal default values.*/{   flt_num = -1;   clock_start = -1;   state = null;}void Plane::refuse() const/*Post: Processes a Plane wanting to use Runway, when      the Queue is full.*/{   cout << "Plane number " << flt_num;   if (state == arriving)      cout << " directed to another airport" << endl;   else      cout << " told to try to takeoff again later" << endl;}void Plane::land(int time) const/*Post: Processes a Plane that is landing at the specified time.*/{   int wait = time - clock_start;   cout << time << ": Plane number " << flt_num << " landed after "        << wait << " time unit" << ((wait == 1) ? "" : "s")        << " in the takeoff queue." << endl;}void Plane::fly(int time) const/*Post: Process a Plane that is taking off at the specified time.*/{   int wait = time - clock_start;   cout << time << ": Plane number " << flt_num << " took off after "        << wait << " time unit" << ((wait == 1) ? "" : "s")        << " in the takeoff queue." << endl;}int Plane::started() const/*Post: Return the time that the Plane entered the airport system.*/{   return clock_start;}void run_idle(int time)/*Post: The specified time is printed with a message that the runway is idle.*/{   cout << time << ": Runway is idle." << endl;}void Runway::shut_down(int time) const/*Post: Runway usage statistics are summarized and printed.*/{   cout << "Simulation has concluded after " << time << " time units." << endl        << "Total number of planes processed "        << (num_land_requests + num_takeoff_requests) << endl        << "Total number of planes asking to land "        << num_land_requests << endl        << "Total number of planes asking to take off "        << num_takeoff_requests << endl        << "Total number of planes accepted for landing "        << num_land_accepted << endl        << "Total number of planes accepted for takeoff "        << num_takeoff_accepted << endl        << "Total number of planes refused for landing "        << num_land_refused << endl        << "Total number of planes refused for takeoff "        << num_takeoff_refused << endl        << "Total number of planes that landed "        << num_landings << endl        << "Total number of planes that took off "        << num_takeoffs << endl        << "Total number of planes left in landing queue "        << landing.size() << endl        << "Total number of planes left in takeoff queue "        << takeoff.size() << endl;   cout << "Percentage of time runway idle "        << 100.0 * (( float ) idle_time) / (( float ) time) << "%" << endl;   cout << "Average wait in landing queue "        << (( float ) land_wait) / (( float ) num_landings) << " time units";   cout << endl << "Average wait in takeoff queue "        << (( float ) takeoff_wait) / (( float ) num_takeoffs)        << " time units" << endl;   cout << "Average observed rate of planes wanting to land "        << (( float ) num_land_requests) / (( float ) time)        << " per time unit" << endl;   cout << "Average observed rate of planes wanting to take off "        << (( float ) num_takeoff_requests) / (( float ) time)        << " per time unit" << endl;}/*************************************************************************/

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品一区二区三区视频| 久久av中文字幕片| 精品国产三级a在线观看| 91麻豆免费观看| 久久99国产精品久久99果冻传媒| 玉足女爽爽91| 国产视频一区在线观看| 91精品国产日韩91久久久久久| 成人一区二区在线观看| 精品一区二区免费在线观看| 亚洲精品国久久99热| 日本一区二区三区dvd视频在线| 欧美日韩一区在线观看| jiyouzz国产精品久久| 精品一区二区在线观看| 午夜精品福利一区二区蜜股av| 欧美激情一区在线| 久久综合成人精品亚洲另类欧美| 欧美丝袜丝nylons| 色先锋aa成人| 菠萝蜜视频在线观看一区| 国产剧情av麻豆香蕉精品| 欧美aaa在线| 午夜精品久久久久久久蜜桃app| 最新高清无码专区| 中文字幕在线不卡一区二区三区| 久久综合狠狠综合久久综合88| 91精品久久久久久蜜臀| 欧美另类z0zxhd电影| 欧美三级电影精品| 欧美午夜精品久久久| 91福利国产精品| 一本色道久久综合狠狠躁的推荐| 99久久免费精品| bt欧美亚洲午夜电影天堂| 国产999精品久久| 国产69精品久久99不卡| 懂色中文一区二区在线播放| 国产精品一区二区三区四区| 国内精品嫩模私拍在线| 国产在线麻豆精品观看| 九色综合狠狠综合久久| 国产在线一区观看| 国产成人啪免费观看软件| 国产99精品在线观看| 成人h动漫精品一区二| 99久久久久免费精品国产| 一本大道久久a久久综合| 色天使久久综合网天天| 欧美性猛交xxxx乱大交退制版| 欧美日韩一区成人| 91精品国产全国免费观看| 日韩午夜在线观看| 2020国产成人综合网| 亚洲国产精品二十页| 日韩美女视频一区| 亚洲国产精品麻豆| 欧美精品一区男女天堂| 久久综合色之久久综合| 国产亚洲欧洲一区高清在线观看| 国产精品女上位| 一区二区三区四区视频精品免费 | 色天使久久综合网天天| 欧美色视频一区| 欧美成人精精品一区二区频| 欧美激情艳妇裸体舞| 亚洲精品中文字幕乱码三区 | 美女被吸乳得到大胸91| 狠狠狠色丁香婷婷综合激情| 成人中文字幕合集| 欧美性大战久久| 2021中文字幕一区亚洲| 国产精品美女视频| 午夜欧美2019年伦理| 韩国av一区二区三区四区| 91在线码无精品| 91精品国产综合久久精品性色| 国产欧美一区二区精品久导航| 一区二区三区欧美久久| 久草热8精品视频在线观看| 波多野结衣亚洲| 欧美久久久久免费| 国产精品久久久久影院| 天天操天天干天天综合网| 丰满少妇在线播放bd日韩电影| 在线精品视频一区二区| 久久久99精品久久| 亚洲国产欧美在线人成| 国产白丝精品91爽爽久久| 911精品国产一区二区在线| 国产精品久久久久久久久免费丝袜| 无吗不卡中文字幕| av电影一区二区| 久久综合色8888| 亚洲午夜久久久| 成人免费视频播放| 日韩精品中文字幕一区| 亚洲制服丝袜av| 丁香婷婷综合网| 欧美电视剧在线观看完整版| 亚洲综合av网| 成人久久视频在线观看| 日韩精品一区二区三区中文不卡| 亚洲人成网站在线| 高清不卡在线观看| 欧美一级搡bbbb搡bbbb| 亚洲黄色片在线观看| 豆国产96在线|亚洲| 欧美成人女星排行榜| 五月激情综合婷婷| 在线中文字幕一区二区| 国产精品三级久久久久三级| 在线免费观看视频一区| 国产精品不卡在线| 成人午夜看片网址| 亚洲精品一区二区三区香蕉| 青娱乐精品视频| 欧美日韩精品一区二区在线播放| 亚洲视频狠狠干| 成人国产精品免费观看视频| 久久青草欧美一区二区三区| 男女性色大片免费观看一区二区| 欧美亚洲国产bt| 亚洲免费在线视频| 91一区二区三区在线播放| 国产欧美日韩精品a在线观看| 国内精品伊人久久久久av一坑 | 色综合久久久久综合体| 国产精品情趣视频| 成人av免费网站| 国产精品天天看| 成人性视频网站| 国产精品久久久久久久久久免费看 | 国产精品欧美一级免费| 国产成人精品免费网站| 国产三级三级三级精品8ⅰ区| 国产一区二区在线观看免费| 日韩欧美一区二区不卡| 久久精品国产精品青草| 欧美一二三区在线观看| 久久电影网电视剧免费观看| 欧美成人精品二区三区99精品| 狠狠狠色丁香婷婷综合激情| 久久久久97国产精华液好用吗| 国产二区国产一区在线观看| 国产午夜精品福利| 97久久超碰国产精品电影| 亚洲色图一区二区三区| 在线免费视频一区二区| 亚洲国产一二三| 欧美一区中文字幕| 国产资源在线一区| 中文字幕第一区综合| 91年精品国产| 午夜成人免费电影| 日韩精品自拍偷拍| 成人久久18免费网站麻豆 | 激情六月婷婷久久| 国产亚洲欧美激情| 91在线视频播放| 天堂成人免费av电影一区| 日韩精品一区二区三区中文不卡| 国产乱人伦偷精品视频免下载 | 亚洲一级不卡视频| 日韩美女在线视频| eeuss国产一区二区三区| 亚洲一区在线观看免费观看电影高清| 欧美年轻男男videosbes| 国产在线不卡一区| 亚洲精品国产视频| 精品国产91久久久久久久妲己| 成人av高清在线| 亚洲aaa精品| 国产亚洲1区2区3区| 欧美在线播放高清精品| 久久99精品久久久久久国产越南| 中文字幕一区二区三区视频 | 国产精品三级电影| 欧美精品国产精品| 成人激情免费电影网址| 日韩一区精品字幕| 国产欧美精品国产国产专区 | 欧美日韩亚洲综合| 粉嫩欧美一区二区三区高清影视| 亚洲成在人线免费| 国产欧美综合在线| 91麻豆精品久久久久蜜臀| bt欧美亚洲午夜电影天堂| 免费的成人av| 亚洲伦在线观看| 久久精品视频在线免费观看| 欧美另类videos死尸| 成人精品视频一区二区三区| 日本成人在线看| 一区二区三区自拍| 中文字幕欧美日本乱码一线二线 | 国产性天天综合网| 制服丝袜中文字幕一区| 91丨porny丨首页| 国产在线一区二区综合免费视频|