2016-07-06 89 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欢迎您。随意标记我的答案是正确的。 :) –