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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? 2.cpp

?? 《數據結構與程序設計》書本所有源代碼!?。。?
?? CPP
字號:
/* Program extracts from Chapter 2 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 2.1:#include   <stack>int main()/*Pre:   The user supplies an integer n and n decimal numbers.Post:  The numbers are printed in reverse order.Uses:  The STL class stack and its methods*/{   int n;   double item;   stack<double> numbers;  //  declares and initializes a stack of numbers   cout << " Type in an integer n followed by n decimal numbers." << endl        << " The numbers will be printed in reverse order." << endl;   cin  >> n;   for (int i = 0; i < n; i++) {      cin >> item;      numbers.push(item);   }   cout << endl << endl;   while (!numbers.empty()) {      cout << numbers.top() << " ";      numbers.pop();   }   cout << endl;}#include <stack>stack<char> s;char x, y, z;s.push('a');s.push('b');s.push('c');s.pop();s.pop();s.pop();s.push('a');s.push('b');s.push('c');x = s.top();s.pop();y = s.top();s.pop();s.push(x);s.push(y);s.pop();s.push('a');s.push('b');s.push('c');while (!s.empty())   s.pop();s.push('a');s.push('b');while (!s.empty()) {   x = s.top();   s.pop();}s.push('c');s.pop();s.push('a');s.pop();s.push('b');s.pop();// Section 2.2:const int maxstack = 10;   //  small value for testingclass Stack {public:   Stack();   bool empty() const;   Error_code pop();   Error_code top(Stack_entry &item) const;   Error_code push(const Stack_entry &item);private:   int count;   Stack_entry entry[maxstack];};Error_code Stack::push(const Stack_entry &item)/*Pre:  None.Post: If the Stack is not full, item is added to the top      of the Stack.  If the Stack is full,      an Error_code of overflow is returned and the Stack is left unchanged.*/{   Error_code outcome = success;   if (count >= maxstack)      outcome = overflow;   else      entry[count++] = item;   return outcome;}Error_code Stack::pop()/*Pre:  None.Post: If the Stack is not empty, the top of      the Stack is removed.  If the Stack      is empty, an Error_code of underflow is returned.*/{   Error_code outcome = success;   if (count == 0)      outcome = underflow;   else --count;   return outcome;}Error_code Stack::top(Stack_entry &item) const/*Pre:  None.Post: If the Stack is not empty, the top of      the Stack is returned in item.  If the Stack      is empty an Error_code of underflow is returned.*/{   Error_code outcome = success;   if (count == 0)      outcome = underflow;   else      item = entry[count - 1];   return outcome;}bool Stack::empty() const/*Pre:  None.Post: If the Stack is empty, true is returned.      Otherwise false is returned.*/{   bool outcome = true;   if (count > 0) outcome = false;   return outcome;}Stack::Stack()/*Pre:  None.Post: The stack is initialized to be empty.*/{   count = 0;}class Extended_stack {public:   Extended_stack();   Error_code pop();   Error_code push(Stack_entry item);   Error_code top(Stack_entry &item) const;   bool empty() const;   void clear(); //  Reset the stack to be empty.   bool full() const ; //  If the stack is full, return true; else return false.   int size() const;   //  Return the number of entries in the stack.private:   int count;   Stack_entry entry[maxstack];};// Section 2.3:typedef double Stack_entry;#include ""int main()/*Post: The program has executed simple arithmetic      commands entered by the user.Uses: The class Stack and the functions      introduction, instructions, do_command, and get_command.*/{   Stack stored_numbers;   introduction();   instructions();   while (do_command(get_command(), stored_numbers));}char get_command(){   char command;   bool waiting = true;   cout << "Select command and press <Enter>:";   while (waiting) {      cin >> command;      command = tolower(command);      if (command == '?' || command == '=' || command == '+' ||          command == '-' || command == '*' || command == '/' ||          command == 'q' ) waiting = false;      else {         cout << "Please enter a valid command:"   << endl              << "[?]push to stack   [=]print top" << endl              << "[+] [-] [*] [/]   are arithmetic operations" << endl              << "[Q]uit." << endl;      }   }   return command;}bool do_command(char command, Stack &numbers)/*Pre:  The first parameter specifies a valid calculator command.Post: The command specified by the first parameter      has been applied to the Stack of numbers given by the second parameter.      A result of true is returned unless command == 'q'.Uses: The class Stack.*/{   double p, q;   switch (command) {   case '?':      cout << "Enter a real number: " << flush;      cin >> p;      if (numbers.push(p) == overflow)         cout << "Warning: Stack full, lost number" << endl;      break;   case '=':      if (numbers.top(p) == underflow)         cout << "Stack empty" << endl;      else         cout << p << endl;      break;   case '+':      if (numbers.top(p) == underflow)         cout << "Stack empty" << endl;      else {         numbers.pop();         if (numbers.top(q) == underflow) {            cout << "Stack has just one entry" << endl;            numbers.push(p);         }         else {            numbers.pop();            if (numbers.push(q + p) == overflow)               cout << "Warning: Stack full, lost result" << endl;         }      }      break;   //   Add options for further user commands.    case 'q':      cout << "Calculation finished.\n";      return false;   }   return true;}// Section 2.4:int main()/*Post: The program has notified the user of any bracket      mismatch in the standard input file.Uses: The class Stack.*/{   Stack openings;   char symbol;   bool is_matched = true;   while (is_matched && (symbol = cin.get()) != '\n') {      if (symbol == '{' || symbol == '(' || symbol == '[')         openings.push(symbol);      if (symbol == '}' || symbol == ')' || symbol == ']') {         if (openings.empty()) {            cout << "Unmatched closing bracket " << symbol                 << " detected." << endl;            is_matched = false;         }         else {            char match;            openings.top(match);            openings.pop();            is_matched = (symbol == '}' && match == '{')                         || (symbol == ')' && match == '(')                         || (symbol == ']' && match == '[');            if (!is_matched)               cout << "Bad match " << match << symbol << endl;         }      }   }   if (!openings.empty())      cout << "Unmatched opening bracket(s) detected." << endl;}// Section 2.5:   if (counter < max) {      openings[counter] = symbol;      counter++;   }if ((xxt == mxx) || (xxt > mxx))    try_again();else {    xx[xxt] = wi;    xxt++;}/*************************************************************************/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩高清一区在线| 亚洲欧美激情小说另类| 欧美a级一区二区| 91精品国产综合久久久久| 日本vs亚洲vs韩国一区三区| 欧美成人精精品一区二区频| 国产精品正在播放| 亚洲色图色小说| 在线看国产一区| 日本欧美加勒比视频| 久久综合九色欧美综合狠狠| 国产成人免费网站| 亚洲综合另类小说| 日韩欧美中文字幕一区| 国产一区二区三区最好精华液| 亚洲国产精品国自产拍av| 在线看不卡av| 久久国产精品一区二区| 欧美经典一区二区三区| 色欧美片视频在线观看 | 久久精品亚洲精品国产欧美kt∨| 懂色av中文字幕一区二区三区 | 亚洲日本韩国一区| 欧美日韩在线直播| 看电视剧不卡顿的网站| 国产精品短视频| 欧美一二三四区在线| 国产精品一线二线三线| 亚洲一区二三区| 久久五月婷婷丁香社区| 色噜噜狠狠成人网p站| 老鸭窝一区二区久久精品| 国产精品色一区二区三区| 欧美剧在线免费观看网站| 高清成人免费视频| 天堂久久久久va久久久久| 久久久久久99精品| 欧美另类videos死尸| 国产.欧美.日韩| 麻豆极品一区二区三区| 亚洲精品美腿丝袜| 久久精品网站免费观看| 欧美日韩国产区一| 91在线精品秘密一区二区| 久久er精品视频| 亚洲午夜视频在线| 中文字幕日本不卡| 久久网这里都是精品| 欧美一区二区视频在线观看2022| 97超碰欧美中文字幕| 国产福利一区二区三区视频在线 | 精品视频一区三区九区| 国产精品一区二区在线观看网站| 五月天亚洲精品| 亚洲人成精品久久久久| 国产女主播一区| 精品国产一区二区在线观看| 欧洲av在线精品| 成人av在线观| 国产乱码精品一区二区三区av| 天天影视网天天综合色在线播放| 亚洲精选在线视频| 成人欧美一区二区三区在线播放| 久久免费美女视频| 精品人伦一区二区色婷婷| 67194成人在线观看| 欧美三级电影在线观看| 91国偷自产一区二区开放时间| 成人免费高清视频在线观看| 国产福利一区二区三区| 国产九色sp调教91| 国产中文字幕一区| 国精品**一区二区三区在线蜜桃| 免费人成在线不卡| 蜜桃在线一区二区三区| 久久精品二区亚洲w码| 玖玖九九国产精品| 国产一区二区三区日韩| 国内精品伊人久久久久影院对白| 久久99精品久久久久久动态图 | 亚洲国产一二三| 亚洲一二三级电影| 亚洲成av人片在线观看无码| 亚洲成av人片在线观看| 五月婷婷激情综合网| 男男gaygay亚洲| 久久精品国产一区二区三区免费看 | 北条麻妃一区二区三区| a美女胸又www黄视频久久| 91一区二区在线| av电影天堂一区二区在线| 99国产精品视频免费观看| 99国产精品久久久久久久久久久| 日本韩国欧美一区二区三区| 欧美亚洲国产怡红院影院| 欧美日韩国产成人在线91| 日韩欧美第一区| 中文字幕 久热精品 视频在线 | 偷拍日韩校园综合在线| 蜜臀久久99精品久久久画质超高清 | 亚洲精品一区二区三区精华液| 精品国产一区二区三区久久影院| 久久这里都是精品| 国产精品美女久久久久高潮| 亚洲一区二区三区免费视频| 天天色图综合网| 国产精品一区免费视频| 91浏览器打开| 欧美大度的电影原声| 中文字幕不卡在线观看| 亚洲第一精品在线| 国产一区二区在线看| 成人免费不卡视频| 欧美色综合影院| 26uuu另类欧美亚洲曰本| 亚洲天堂精品在线观看| 美女爽到高潮91| 99精品欧美一区| 欧美v国产在线一区二区三区| 国产精品亲子伦对白| 午夜精品一区在线观看| 国产精品1024久久| 在线91免费看| 18欧美亚洲精品| 精品一区二区三区在线播放| 色狠狠av一区二区三区| 久久色中文字幕| 亚洲第一搞黄网站| 成人综合日日夜夜| 欧美乱妇15p| 亚洲精品va在线观看| 国产在线精品一区二区三区不卡| 欧美在线观看你懂的| 国产欧美日韩精品一区| 日韩高清国产一区在线| 一本一道波多野结衣一区二区| 精品久久一区二区| 午夜婷婷国产麻豆精品| 91碰在线视频| 欧美激情中文不卡| 精久久久久久久久久久| 欧美欧美欧美欧美首页| 亚洲摸摸操操av| 99久久免费视频.com| 久久久久综合网| 免费观看30秒视频久久| 欧美日韩精品一区二区在线播放 | 亚洲久草在线视频| 成人午夜电影网站| 久久天堂av综合合色蜜桃网| 狂野欧美性猛交blacked| 欧美日韩国产高清一区二区| 一区二区三区在线观看视频| 成人午夜在线视频| 精品国产a毛片| 美女精品一区二区| 91精品国产综合久久婷婷香蕉| 夜夜精品浪潮av一区二区三区| 成人国产精品免费| 欧美国产欧美综合| 国产精品12区| 国产精品网站在线观看| 国内精品不卡在线| 久久久777精品电影网影网| 日本不卡不码高清免费观看| 欧美一区二区高清| 日韩电影一区二区三区四区| 欧美精品aⅴ在线视频| 视频一区中文字幕| 欧美男人的天堂一二区| 日韩精品91亚洲二区在线观看 | 在线亚洲一区观看| 亚洲网友自拍偷拍| 91.xcao| 免费人成精品欧美精品| 精品乱码亚洲一区二区不卡| 激情都市一区二区| 久久综合色之久久综合| 国产一区二区三区黄视频| 国产婷婷色一区二区三区四区| 国产成人精品免费视频网站| 亚洲欧洲国产专区| 欧美色图12p| 精品在线播放免费| 国产午夜精品久久久久久免费视 | 色婷婷av一区二区三区大白胸| 一区二区三区精品| 欧美日韩免费在线视频| 蜜桃精品视频在线| 国产视频911| 91麻豆文化传媒在线观看| 午夜精品成人在线视频| 日韩精品一区二区三区在线| 粉嫩一区二区三区在线看| 一区二区三区四区不卡视频| 制服丝袜中文字幕亚洲| 国产福利91精品| 亚洲自拍另类综合| 精品剧情v国产在线观看在线| 成人精品gif动图一区|