C++ 教程 C++ 实例 - 输出换行

romeo · 2022-04-10 15:19:33 · 热度: 78

使用 C++ 输出,并对多个输出内容进行换行,使用 \n 或 endl:

实例 - \n 换行

#include <iostream> using namespace std; int main() { cout << "Codercto \n"; cout << "Google \n"; cout << "Taobao"; return 0; }

实例 - endl 换行

#include <iostream> using namespace std; int main() { cout << "Codercto" << endl; cout << "Google" << endl; cout << "Taobao"; return 0; }

以上程序执行输出结果为:

Codercto 
Google 
Taobao

查看更多 C++ 实例

猜你喜欢:
暂无回复。
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册