代码
#include<iostream>
using namespace std;
int main(){
cout<<"hello world" << endl;
system("pause");
}
解释
#include<iostream>:引入头文件,然后才能使用std、coutusing namespace std;:告诉编译器使用std命名空间,使用该命名空间后,才能在下面直接使用cout、endlint main():入口函数,相当于学校大门口,都从这个门口进cout<<"hello world":向控制台打印hello worldendl:换行,也可以是\nsystem("pause");:相当于在 dos下执行pause命令