windows下的点一下回车,效果是:回车换行,就是\r\n
unix系统下的回车一下就是一个\n
给出如下代码:
- #include <iostream>
- using namespace std;
- int main()
- {
- cout << "this is the first line\n";
- cout << "this is the second line\r";
- cout << "this is the third line\n";
- cout << "this is the fouth line\r";
- cout << "this is the fifth line\n";
- cout << "end" ;
- return 0;
- }
运行结果如下: