方法1:
#include <iostream>
//命名空间
using namespace std;
void main()
{
cout<<"hello world !"<<endl;
}
方法2:
#include <iostream>
void main()
{
std::cout<<"hello world !"<<std::endl;
}
方法3:
#include <iostream>
using std::cout;
using std::endl;
void main()
{
cout<<"hello world !"<<endl;
}
执行结果: