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

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

?? 3.cpp

?? 《數(shù)據(jù)結(jié)構(gòu)與程序設(shè)計(jì)》書(shū)本所有源代碼!!!!
?? CPP
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/* Program extracts from Chapter 3 of   "Data Structures and Program Design in C++"   by Robert L. Kruse and Alexander J. Ryba   Copyright (C) 1999 by Prentice-Hall, Inc.  All rights reserved.   Extracts from this file may be used in the construction of other programs,   but this code will not compile or execute as given here. */// Section 3.1:class Queue {public:   Queue();   bool empty() const;   Error_code append(const Queue_entry &x);   Error_code serve();   Error_code retrieve(Queue_entry &x) const;// Additional members will represent queue data.};class Extended_queue: public Queue {public:   bool full() const;   int size() const;   void clear();   Error_code serve_and_retrieve(Queue_entry &item);};Queue q;q.append('a');q.serve();q.append('b');q.serve();q.append('c');q.append('d');q.serve();Queue q;q.append('a');q.append('b');q.retrieve(x);q.serve();q.append('c');q.append(x);q.serve();q.serve();Queue q;q.append('a');x = 'b';q.append('x');q.retrieve(y);q.serve();q.append(x);q.serve();q.append(y);// Section 3.3:const int maxqueue = 10; //  small value for testingclass Queue {public:   Queue();   bool empty() const;   Error_code serve();   Error_code append(const Queue_entry &item);   Error_code retrieve(Queue_entry &item) const;protected:   int count;   int front, rear;   Queue_entry entry[maxqueue];};Queue::Queue()/*Post: The Queue is initialized to be empty.*/{   count = 0;   rear = maxqueue - 1;   front = 0;}bool Queue::empty() const/*Post: Return true if the Queue is empty, otherwise return false.*/{   return count == 0;}Error_code Queue::append(const Queue_entry &item)/*Post: item is added to the rear of the Queue. If the Queue is fullreturn an Error_code of overflow and leave the Queue unchanged.*/{   if (count >= maxqueue) return overflow;   count++;   rear = ((rear + 1) == maxqueue) ? 0 : (rear + 1);   entry[rear] = item;   return success;}Error_code Queue::serve()/*Post: The front of the Queue is removed. If the Queueis empty return an Error_code of underflow.*/{   if (count <= 0) return underflow;   count--;   front = ((front + 1) == maxqueue) ? 0 : (front + 1);   return success;}Error_code Queue::retrieve(Queue_entry &item) const/*Post: The front of the Queue retrieved to the output      parameter item. If the Queue is empty return an Error_code of underflow.*/{   if (count <= 0) return underflow;   item = entry[front];   return success;}int Extended_queue::size() const/*Post:   Return the number of entries in the Extended_queue.*/{   return count;}// Section 3.4:int main()/*Post: Accepts commands from user as a menu-driven demonstration program for      the class Extended_queue.Uses: The class Extended_queue and the functions introduction,      get_command, and do_command.*/{   Extended_queue test_queue;   introduction();   while (do_command(get_command(), test_queue));}void help()/*Post: A help screen for the program is printed, giving the meaning of each      command that the user may enter.*/{   cout << endl        << "This program allows the user to enter one command" << endl        << "(but only one) on each input line." << endl        << "For example, if the command S is entered, then" << endl        << "the program will serve the front of the queue." << endl        << endl        << " The valid commands are:" << endl        << "A - Append the next input character to the extended queue" << endl        << "S - Serve the front of the extended queue" << endl        << "R - Retrieve and print the front entry." << endl        << "# - The current size of the extended queue" << endl        << "C - Clear the extended queue (same as delete)" << endl        << "P - Print the extended queue" << endl        << "H - This help screen" << endl        << "Q - Quit" << endl        << "Press <Enter> to continue." << flush;   char c;   do {      cin.get(c);   } while (c != '\n');}bool do_command(char c, Extended_queue &test_queue)/*Pre:  c represents a valid command.Post: Performs the given command c on the Extended_queue test_queue.      Returns false if c == 'q', otherwise returns true.Uses: The class Extended_queue.*/{   bool continue_input = true;   Queue_entry x;   switch (c) {   case 'r':      if (test_queue.retrieve(x) == underflow)         cout << "Queue is empty." << endl;      else         cout << endl              << "The first entry is: " << x              << endl;      break;   case 'q':      cout << "Extended queue demonstration finished." << endl;      continue_input = false;      break;    //  Additional cases will cover other commands.   }   return continue_input;}// Section 3.5:int main()     //  Airport simulation program/*Pre:  The user must supply the number of time intervals the simulation is to      run, the expected number of planes arriving, the expected number      of planes departing per time interval, and the      maximum allowed size for runway queues.Post: The program performs a random simulation of the airport, showing      the status of the runway at each time interval, and prints out a      summary of airport operation at the conclusion.Uses: Classes Runway, Plane, Random and functions run_idle, initialize.*/{   int end_time;            //  time to run simulation   int queue_limit;         //  size of Runway queues   int flight_number = 0;   double arrival_rate, departure_rate;   initialize(end_time, queue_limit, arrival_rate, departure_rate);   Random variable;   Runway small_airport(queue_limit);   for (int current_time = 0; current_time < end_time; current_time++) { //  loop over time intervals      int number_arrivals = variable.poisson(arrival_rate);  //  current arrival requests      for (int i = 0; i < number_arrivals; i++) {         Plane current_plane(flight_number++, current_time, arriving);         if (small_airport.can_land(current_plane) != success)            current_plane.refuse();      }      int number_departures= variable.poisson(departure_rate); //  current departure requests      for (int j = 0; j < number_departures; j++) {         Plane current_plane(flight_number++, current_time, departing);         if (small_airport.can_depart(current_plane) != success)            current_plane.refuse();      }      Plane moving_plane;      switch (small_airport.activity(current_time, moving_plane)) {        //  Let at most one Plane onto the Runway at current_time.      case land:         moving_plane.land(current_time);         break;      case takeoff:         moving_plane.fly(current_time);         break;      case idle:         run_idle(current_time);      }   }   small_airport.shut_down(end_time);}enum Runway_activity {idle, land, takeoff};class Runway {public:   Runway(int limit);   Error_code can_land(const Plane &current);   Error_code can_depart(const Plane &current);   Runway_activity activity(int time, Plane &moving);   void shut_down(int time) const;private:   Extended_queue landing;   Extended_queue takeoff;   int queue_limit;   int num_land_requests;        //  number of planes asking to land   int num_takeoff_requests;     //  number of planes asking to take off   int num_landings;             //  number of planes that have landed   int num_takeoffs;             //  number of planes that have taken off

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99久久99久久综合| 日韩女同互慰一区二区| 男女男精品视频网| 日韩毛片一二三区| www久久久久| 欧美人伦禁忌dvd放荡欲情| 99视频在线观看一区三区| 久久精品噜噜噜成人88aⅴ| 亚洲国产精品久久一线不卡| 国产精品久久久久影院| 精品嫩草影院久久| 宅男噜噜噜66一区二区66| 91美女片黄在线观看| 成人一级片网址| 国产精品资源站在线| 青青草成人在线观看| 五月婷婷综合在线| 一区二区久久久久| 亚洲精品美腿丝袜| 亚洲乱码日产精品bd| 欧美经典一区二区| 国产日本一区二区| 久久嫩草精品久久久久| 欧美精品一区二区在线播放| 欧美一区三区二区| 日韩一区二区麻豆国产| 91精品国产综合久久国产大片| 欧美视频在线一区| 欧美色电影在线| 欧美日韩精品高清| 欧美肥胖老妇做爰| 在线电影一区二区三区| 91精品在线观看入口| 欧美理论在线播放| 制服丝袜在线91| 91精品蜜臀在线一区尤物| 欧美日韩一卡二卡三卡| 欧美高清视频一二三区| 6080日韩午夜伦伦午夜伦| 欧美一二三在线| 欧美精品一区视频| 国产日韩精品一区二区浪潮av| 国产欧美日韩在线| 亚洲日本免费电影| 亚洲成人动漫在线观看| 日韩高清欧美激情| 另类小说视频一区二区| 国产精品中文字幕欧美| 成人国产精品免费网站| 97久久精品人人做人人爽50路| 色综合久久久久综合体桃花网| 91麻豆.com| 在线电影国产精品| 久久视频一区二区| 综合av第一页| 午夜精品福利视频网站| 秋霞影院一区二区| 国产成人免费av在线| 一本色道亚洲精品aⅴ| 欧美午夜精品电影| 精品三级av在线| 国产精品伦理一区二区| 一区二区三区中文字幕精品精品| 亚洲风情在线资源站| 美女被吸乳得到大胸91| 成人深夜在线观看| 欧美唯美清纯偷拍| 欧美va亚洲va在线观看蝴蝶网| 国产精品色眯眯| 亚洲成人精品一区| 国产成人午夜高潮毛片| 欧美无砖砖区免费| 亚洲精品在线观| 一区二区三区中文字幕电影| 蓝色福利精品导航| 色婷婷av一区二区| 久久综合九色综合97婷婷| 亚洲人xxxx| 久久99精品国产麻豆婷婷洗澡| 99国产欧美久久久精品| 日韩美女一区二区三区四区| 国产精品久久久久aaaa| 免费日韩伦理电影| 色综合久久久久久久| 精品剧情v国产在线观看在线| 成人免费一区二区三区视频| 久久精品国产秦先生| 91国模大尺度私拍在线视频| 久久久久亚洲蜜桃| 午夜精品福利一区二区蜜股av| 国产不卡免费视频| 欧美一区二区视频免费观看| 中文字幕视频一区| 激情综合五月天| 欧美午夜一区二区三区| 国产精品三级久久久久三级| 蜜臀久久久99精品久久久久久| 97久久精品人人爽人人爽蜜臀 | 欧美日韩在线亚洲一区蜜芽| 久久久欧美精品sm网站| 天堂一区二区在线| 91在线观看成人| 国产欧美精品国产国产专区| 看片的网站亚洲| 欧美日韩性生活| 亚洲人成网站影音先锋播放| 国产成人av自拍| 久久综合狠狠综合久久综合88| 丝袜脚交一区二区| 在线区一区二视频| 亚洲欧美区自拍先锋| 成人av片在线观看| 国产午夜精品在线观看| 精品一区二区在线看| 欧美一区二区播放| 午夜精品福利在线| 欧美日韩一级视频| 亚洲第一综合色| 欧美唯美清纯偷拍| 一区二区三区波多野结衣在线观看| 国产99久久久国产精品潘金 | 日本亚洲欧美天堂免费| 欧美性一二三区| 一片黄亚洲嫩模| 在线影视一区二区三区| 亚洲欧美日韩久久| 91久久一区二区| 夜夜亚洲天天久久| 欧美日韩午夜影院| 三级欧美韩日大片在线看| 欧美熟乱第一页| 天堂成人国产精品一区| 欧美挠脚心视频网站| 日韩精品一级中文字幕精品视频免费观看| 色狠狠av一区二区三区| 亚洲一卡二卡三卡四卡无卡久久 | 国产伦精品一区二区三区视频青涩| 日韩免费福利电影在线观看| 精品一区二区三区在线观看| 久久综合色婷婷| 国产成人av一区二区三区在线观看| 久久精品一区二区三区四区| 国产jizzjizz一区二区| 日韩毛片精品高清免费| 欧美午夜不卡视频| 蜜桃视频第一区免费观看| 日韩欧美色电影| 国产剧情在线观看一区二区| 中文av一区特黄| 91免费国产在线观看| 亚洲国产精品自拍| 欧美zozozo| 国产黄人亚洲片| 亚洲欧美一区二区久久| 欧美精品视频www在线观看| 奇米影视7777精品一区二区| 久久久不卡网国产精品二区| 成人激情免费视频| 亚洲一区在线观看视频| 欧美成人精品福利| 国产成人免费视频一区| 夜夜嗨av一区二区三区网页| 日韩三级视频在线看| 国产成人三级在线观看| 亚洲最色的网站| 欧美成人video| 93久久精品日日躁夜夜躁欧美| 亚洲一区二区免费视频| 日韩美女视频在线| 99re热这里只有精品视频| 婷婷久久综合九色综合绿巨人| 精品噜噜噜噜久久久久久久久试看| 99热99精品| 日韩av在线发布| 国产精品亲子乱子伦xxxx裸| 精品视频在线免费观看| 国产成人精品免费在线| 亚洲成av人综合在线观看| 久久久久久久久99精品| 欧美亚日韩国产aⅴ精品中极品| 国产美女一区二区三区| 一二三四区精品视频| 国产无人区一区二区三区| 欧美三电影在线| av亚洲精华国产精华精| 免费在线观看日韩欧美| 亚洲精品日韩专区silk| 久久久久久久久蜜桃| 欧美日韩情趣电影| 99精品欧美一区| 国产福利一区在线| 免费成人在线网站| 一区二区三区不卡视频| 国产欧美一区二区在线观看| 欧美一区二区三区免费观看视频| 99re这里只有精品首页| 国产高清久久久久| 免费成人你懂的| 亚洲成av人片一区二区梦乃| 国产精品第五页|