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

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

        <tfoot id='iADPL'></tfoot>

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

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

      1. Visual Studio Code:從用戶獲取輸入

        Visual Studio Code: Take Input From User(Visual Studio Code:從用戶獲取輸入)

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

            <tbody id='AUSTL'></tbody>
            • <tfoot id='AUSTL'></tfoot>
                <bdo id='AUSTL'></bdo><ul id='AUSTL'></ul>
                <legend id='AUSTL'><style id='AUSTL'><dir id='AUSTL'><q id='AUSTL'></q></dir></style></legend>

                • <i id='AUSTL'><tr id='AUSTL'><dt id='AUSTL'><q id='AUSTL'><span id='AUSTL'><b id='AUSTL'><form id='AUSTL'><ins id='AUSTL'></ins><ul id='AUSTL'></ul><sub id='AUSTL'></sub></form><legend id='AUSTL'></legend><bdo id='AUSTL'><pre id='AUSTL'><center id='AUSTL'></center></pre></bdo></b><th id='AUSTL'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='AUSTL'><tfoot id='AUSTL'></tfoot><dl id='AUSTL'><fieldset id='AUSTL'></fieldset></dl></div>
                • 本文介紹了Visual Studio Code:從用戶獲取輸入的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  目前,我正在嘗試用 Visual Studio 代碼編寫 C/C++ 程序.為此,我安裝了兩個擴展:C/C++ &C++ 智能感知

                  Currently, I'm trying to write C/C++ program in Visual Studio code. For this I've installed two extensions: C/C++ & C++ Intellisense

                  根據文檔,調試工具不適用于 Windows.我已經能夠通過以下任務構建和運行代碼:

                  As per the documentation, the debugging facility is not available for windows. I've been able to build and run the code with the following tasks:

                  {
                      "version": "0.1.0",
                      "command": "cmd",
                      "isShellCommand": true,
                      "args": [
                          "/C"
                      ],
                      "tasks": [
                          {
                              "taskName": "Makefile",
                              "suppressTaskName": true,
                              // Make this the default build command.
                              "isBuildCommand": true,
                              // Show the output window only if unrecognized errors occur.
                              "showOutput": "always",
                              // No args
                              "args": [
                                  "C:/Programs/cygwin/bin/make.exe",
                                  "all"
                              ],
                              // Use the standard less compilation problem matcher.
                              "problemMatcher": {
                                  "owner": "cpp",
                                  "fileLocation": [
                                      "relative",
                                      "${workspaceRoot}"
                                  ],
                                  "pattern": {
                                      "regexp": "^(.*):(\d+):(\d+):\s+(warning|error):\s+(.*)$",
                                      "file": 1,
                                      "line": 2,
                                      "column": 3,
                                      "severity": 4,
                                      "message": 5
                                  }
                              }
                          },
                          {
                              "taskName": "Run",
                              "suppressTaskName": true,
                              "isTestCommand": true,
                              "args": [
                                  "helloworld"
                              ]
                          }
                      ]
                  }
                  

                  和一個簡單的Makefile:

                  all: clean helloworld
                  
                  helloworld: helloworld.cpp
                      C:/Programs/cygwin/bin/g++ helloworld.cpp -o helloworld
                  
                  clean:
                      C:/Programs/cygwin/bin/rm -rf helloworld
                  

                  但是,當程序在運行時需要一些用戶輸入時,就會出現問題.假設對于這個非常熟悉的 helloworld 程序.

                  But, the problem arises, when the programs needs some user input while running. Suppose for this very familiar helloworld program.

                  # include <iostream>
                  
                  using namespace std;
                  
                  int main ()
                  {
                    int name;
                  
                    cin >> name;
                  
                    cout << "Hello, " << name << "!!!" << endl;
                  
                    return 0;
                  }
                  

                  你能幫我在運行時獲取用戶輸入嗎?有一種變通方法可以將輸入作為命令行參數傳遞.但是,對于具有復雜流程的程序來說,這是不可能的.

                  Can you please help me to get the user input at run time. There is a work-around to pass the input as command line arguments. But, that is not possible for programs with complex flows.

                  推薦答案

                  轉到 Code ->首選項 ->設置并添加自定義設置:

                  Go to Code -> Preferences -> Settings and add custom settings:

                  {
                     "code-runner.runInTerminal": true
                  }
                  

                  最后運行你的 C++ 代碼,你將能夠在控制臺中輸入值

                  Finally run your c++ code and you will be able to enter values in console

                  這篇關于Visual Studio Code:從用戶獲取輸入的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  In what ways do C++ exceptions slow down code when there are no exceptions thown?(當沒有異常時,C++ 異常會以何種方式減慢代碼速度?)
                  Why catch an exception as reference-to-const?(為什么要捕獲異常作為對 const 的引用?)
                  When and how should I use exception handling?(我應該何時以及如何使用異常處理?)
                  Scope of exception object in C++(C++中異常對象的范圍)
                  Catching exceptions from a constructor#39;s initializer list(從構造函數的初始化列表中捕獲異常)
                  Difference between C++03 throw() specifier C++11 noexcept(C++03 throw() 說明符 C++11 noexcept 之間的區別)
                  <legend id='NuiOB'><style id='NuiOB'><dir id='NuiOB'><q id='NuiOB'></q></dir></style></legend>

                    <tfoot id='NuiOB'></tfoot>
                        <bdo id='NuiOB'></bdo><ul id='NuiOB'></ul>

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

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

                            <tbody id='NuiOB'></tbody>
                          1. 主站蜘蛛池模板: 国产目拍亚洲精品99久久精品 | 日韩精品一区二区三区中文字幕 | 97伦理电影网 | 日本不卡免费新一二三区 | 日韩福利在线 | 欧美影院 | 成人午夜视频在线观看 | 亚洲精品日日夜夜 | 精品一区二区电影 | 国产免费又色又爽又黄在线观看 | 亚洲成人一区二区 | 久久一二三区 | 久久久久av | 成人在线观看免费 | 国产小视频在线 | 欧美日韩黄色一级片 | 日本大香伊一区二区三区 | 卡通动漫第一页 | 国产又色又爽又黄又免费 | 国产精彩视频在线观看 | 国产精品久久久久久中文字 | 波多野结衣精品在线 | 国产精品视频久久久 | 欧美成人精品一区 | 男女羞羞视频免费看 | 日韩视频二区 | 午夜影院在线观看版 | 中文字幕 在线观看 | 激情五月综合网 | 亚洲欧美日韩成人在线 | 成人黄色电影免费 | 久久免费香蕉视频 | 在线午夜 | 成人免费小视频 | 国产一区 | 狠狠爱网址 | 国产精品明星裸体写真集 | 男女羞羞视频免费看 | 爱操影视 | 国产精品一区二区福利视频 | 激情黄色在线观看 |