#include <stdlib.h>
#include <iostream>
using namespace std;
int main()
{
cout<<"Hello World "<<endl;
system("pause");
return 0;
}
包含头文件stdlib.h
,并在主程序中加入system("pause")
; 可以在程序运行完以后使黑框暂停显示
,等待输入,而不是闪退。
#include <stdlib.h>
#include <iostream>
using namespace std;
int main()
{
cout<<"Hello World "<<endl;
system("pause");
return 0;
}
包含头文件stdlib.h
,并在主程序中加入system("pause")
; 可以在程序运行完以后使黑框暂停显示
,等待输入,而不是闪退。