
n 换行,光标移到下一行的开头;
endl,把缓冲槽的内容输出到控制台;
r 回车,光标移到当前行的开头,不会换到下一行,如果接着输出的话,本行以前的内容会被逐一覆盖;
#include using namespace std; int main() { cout << "this is the first linen"; cout << "this is the second liner"; cout << "this is the third linen"; cout << "this is the fouth liner"; cout << "this is the fifth linen"; cout<<"First"<<"n"<<"Second"<<endl; cout<<"First123"<<"r"<<"Second"<<endl; cout<<"这是换"<<endl<<"行符"; return 0; }
结果:
立即学习“C++免费学习笔记(深入)”;
this is the first linethis is the third lineethis is the fifth lineFirstSecondSecond23这是换行符Presss any key to continue
推荐课程:C语言教程
以上就是c++++换行符有哪些的详细内容,更多请关注创想鸟其它相关文章!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/1433318.html
微信扫一扫
支付宝扫一扫