#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
cout << "hello word!" << endl; // 输出hello word!
cin.get();//判断回车键是否按下 可让控制台停留 防止程序执行完后直接关闭
return 0;
}
本文展示了一个简单的C++程序,用于输出字符串helloworld!到控制台,并通过cin.get()函数使程序暂停等待用户按键,避免控制台窗口立即关闭。
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
cout << "hello word!" << endl; // 输出hello word!
cin.get();//判断回车键是否按下 可让控制台停留 防止程序执行完后直接关闭
return 0;
}

被折叠的 条评论
为什么被折叠?