#include<iostream>
using namespace std;
int main() {
cout << "hello,world" << endl;
return 0;
}
#include <iostream>
是预处理指令,<iostream>
是 C++标准库里提供输入输出功能的头文件。本质是把头文件内容在编译前插入到代码.using namespace std;
是命名空间使用声明,把std命名空间里的所有名字直接引入当前作用域,不用每次写std::
,否则输出语句cout
要写为std::cout