method 1:原始的c方法和经典的c++方法
#include <cstdio>
#include <iostream>
using namespace std;
int main()
{
printf("Hello world");
puts("Hello world");
cout << "Hello world" << endl;
return 0;
}
这几个都可以
这也ok
#include <iostream>
using namespace std;
int main()
{
cout << "Hello, World!";
return 0;
}
同样ok
#include <iostream>
using namespace std;
int main()
{
cout << "Hello, World!"<<endl;
return 0;
}
在第6行加入刷新可能会更快,如下
#include <iostream>
using namespace std;
int main()
{
cout << "Hello, World!" << endl;
system("pause");
return 0;
}