C++ 实例 - 输出换行
使用 C++ 输出,并对多个输出内容进行换行,使用 \n 或 endl:
实例 - \n 换行
#include <bits/stdc++.h>
using namespace std;
int main() {
cout << “xjyoj\n";
cout << “google\n";
cout << “taobao";
return 0;
}
实例 - endl 换行
#include <bits/stdc++.h>
using namespace std;
int main() {
cout << “xjyoj” << endl;
cout << “google" << endl;
cout << “taobao";
return 0;
}
以上程序执行输出结果为:
xjyoj
google
taobao