2016-07-06 59 views
0
#include <iostream> 
using namespace std; 

int main() 
{ 
    int a, b = 10, c; 
    int age = 23; 
    float average; 
    char gender = 'm'; 
    bool isit = true; 

    average = 22.45; 

    cout << age << endl << average << endl << gender << endl << isit; 

    return 0; 
} 

我不知道,但我正在使用Microsoft Visual Studio C++我不知道它是否與設置有關,但是當我構建並運行它時,命令提示符窗口失修。C++幫助。找不到類型命令

+0

頂部我把#include dreadblood

+0

檢查:[複製](http://stackoverflow.com/questions/2529617/how-to-stop-c-console-application-from-exiting-immediately) –

回答

1

把這個底:

cin.get(); 

它會等待用戶輸入。

+0

一些解釋將是偉大的 – Li357

+0

謝謝:)))) – dreadblood

+0

@ dreadblood歡迎您。隨意標記我的答案是正確的。 :) –