- ends: 终止字符串
- endl: 终止一行 并刷新缓冲区
- flush: 刷新缓冲区的数据
#include <iostream> int main() { using namespace std; cout << "a" ; cout << "b" <<ends; cout << "c" <<endl; cout << "e" << flush; cout << "f" << flush; cout << "g" ; cout << "h" <<ends; cout << "i" << flush; cout << "j" <<endl; return 0; } 结果 ab c efgh ij