久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <i id='OTKol'><tr id='OTKol'><dt id='OTKol'><q id='OTKol'><span id='OTKol'><b id='OTKol'><form id='OTKol'><ins id='OTKol'></ins><ul id='OTKol'></ul><sub id='OTKol'></sub></form><legend id='OTKol'></legend><bdo id='OTKol'><pre id='OTKol'><center id='OTKol'></center></pre></bdo></b><th id='OTKol'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='OTKol'><tfoot id='OTKol'></tfoot><dl id='OTKol'><fieldset id='OTKol'></fieldset></dl></div>

      <legend id='OTKol'><style id='OTKol'><dir id='OTKol'><q id='OTKol'></q></dir></style></legend>

      <small id='OTKol'></small><noframes id='OTKol'>

      • <bdo id='OTKol'></bdo><ul id='OTKol'></ul>
      <tfoot id='OTKol'></tfoot>
    1. 為什么在我包含 cin.get() 后控制臺會關閉?

      Why is the Console Closing after I#39;ve included cin.get()?(為什么在我包含 cin.get() 后控制臺會關閉?)

          • <bdo id='n1Gqs'></bdo><ul id='n1Gqs'></ul>

            1. <i id='n1Gqs'><tr id='n1Gqs'><dt id='n1Gqs'><q id='n1Gqs'><span id='n1Gqs'><b id='n1Gqs'><form id='n1Gqs'><ins id='n1Gqs'></ins><ul id='n1Gqs'></ul><sub id='n1Gqs'></sub></form><legend id='n1Gqs'></legend><bdo id='n1Gqs'><pre id='n1Gqs'><center id='n1Gqs'></center></pre></bdo></b><th id='n1Gqs'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='n1Gqs'><tfoot id='n1Gqs'></tfoot><dl id='n1Gqs'><fieldset id='n1Gqs'></fieldset></dl></div>
                <legend id='n1Gqs'><style id='n1Gqs'><dir id='n1Gqs'><q id='n1Gqs'></q></dir></style></legend>

                <small id='n1Gqs'></small><noframes id='n1Gqs'>

                  <tbody id='n1Gqs'></tbody>
                <tfoot id='n1Gqs'></tfoot>
                本文介紹了為什么在我包含 cin.get() 后控制臺會關閉?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                限時送ChatGPT賬號..

                我剛剛開始使用 C++ Primer Plus 學習 C++,但我在其中一個示例中遇到了問題.就像書中指示的那樣,我在末尾包含了 cin.get() 以防止控制臺自行關閉.但是,在這種情況下,除非我添加兩個我不理解的 cin.get() 語句,否則它仍然會自行關閉.我使用的是 Visual Studio Express 2010.

                I've just started learning C++ using C++ Primer Plus but I'm having trouble with one of the examples. Like the book instructed I included cin.get() at the end to prevent the console from closing by itself. However, in this instance it still closes by itself unless I add two cin.get() statements which I don't understand. I'm using Visual Studio Express 2010.

                #include <iostream>
                
                int main()
                {
                    int carrots;
                
                    using namespace std;
                    cout << "How many carrots do you have?" << endl;
                    cin >> carrots;
                    carrots = carrots + 2;
                    cout << "Here are two more. Now you have " << carrots << " carrots.";
                    cin.get();
                    return 0;
                }
                

                推薦答案

                cin >> carrots;
                

                這一行在輸入流中留下一個尾隨換行符,然后被下一個 cin.get() 使用.在此之前直接執行一個簡單的 cin.ignore() :

                This line leaves a trailing newline token in the input stream, which then gets consumed by the next cin.get(). Just do a simple cin.ignore() directly before that:

                cin.ignore();
                cin.get();
                

                這篇關于為什么在我包含 cin.get() 后控制臺會關閉?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                Why do two functions have the same address?(為什么兩個函數的地址相同?)
                Why the initializer of std::function has to be CopyConstructible?(為什么 std::function 的初始化程序必須是可復制構造的?)
                mixing templates with polymorphism(混合模板與多態性)
                When should I use the keyword quot;typenamequot; when using templates(我什么時候應該使用關鍵字“typename?使用模板時)
                Dependent name resolution amp; namespace std / Standard Library(依賴名稱解析命名空間 std/標準庫)
                gcc can compile a variadic template while clang cannot(gcc 可以編譯可變參數模板,而 clang 不能)

                  <small id='VGZ29'></small><noframes id='VGZ29'>

                1. <i id='VGZ29'><tr id='VGZ29'><dt id='VGZ29'><q id='VGZ29'><span id='VGZ29'><b id='VGZ29'><form id='VGZ29'><ins id='VGZ29'></ins><ul id='VGZ29'></ul><sub id='VGZ29'></sub></form><legend id='VGZ29'></legend><bdo id='VGZ29'><pre id='VGZ29'><center id='VGZ29'></center></pre></bdo></b><th id='VGZ29'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='VGZ29'><tfoot id='VGZ29'></tfoot><dl id='VGZ29'><fieldset id='VGZ29'></fieldset></dl></div>
                  <legend id='VGZ29'><style id='VGZ29'><dir id='VGZ29'><q id='VGZ29'></q></dir></style></legend>
                  <tfoot id='VGZ29'></tfoot>
                        <bdo id='VGZ29'></bdo><ul id='VGZ29'></ul>
                          <tbody id='VGZ29'></tbody>
                        • 主站蜘蛛池模板: 91在线电影 | 伊人精品一区二区三区 | 欧美日韩免费 | 午夜av电影 | av毛片在线播放 | 亚洲在线 | 成人性视频在线 | 国产伦精品一区二区三区精品视频 | 夜夜爽99久久国产综合精品女不卡 | 亚洲精品一区二区三区蜜桃久 | 男女又爽又黄视频 | 日韩成人影院 | 91九色视频 | 国产精品一区二区av | 在线看亚洲 | 久久精品av麻豆的观看方式 | 国产98色在线 | 国产精品精品视频一区二区三区 | 最新国产福利在线 | 激情一区二区三区 | 欧美一级二级在线观看 | 日韩一级免费电影 | 在线观看免费国产 | 欧美精品中文 | 亚洲国产小视频 | 欧美日韩一区二区三区四区五区 | 国产精品一区二区欧美黑人喷潮水 | 一本大道久久a久久精二百 国产成人免费在线 | 在线免费观看视频黄 | 国产一区二区三区四区五区加勒比 | 国产欧美在线播放 | 91精品麻豆日日躁夜夜躁 | 国产精品96久久久久久 | 精品一区二区av | 日本网站免费观看 | 国产精品毛片久久久久久久 | 亚洲精品视频免费看 | 欧美一区二区三区在线观看视频 | 久久激情五月丁香伊人 | 久久国产视频播放 | 中国美女撒尿txxxxx视频 |