【发布时间】:2013-11-23 22:48:40
【问题描述】:
我有一个卡片组,可以一次将卡片打印到终端上。然而,由于终端的工作方式,它们垂直打印。有什么方法或功能可以让它们并排打印吗?这是我的代码示例。
cout << "---------" << endl;
cout << "|"<<"6"<<setw(7)<<"|"<<endl;
cout << "|"<<setw(4)<< "S" << setw(6)<<"S"<<setw(2)<<"|"<<endl;
cout << "|"<<setw(8)<<"|"<<endl;
cout << "|"<<setw(8)<<"|"<<endl;
cout << "|"<<setw(4)<< "S" << setw(6)<<"S" <<setw(2)<<"|"<<endl;
cout << "|"<<setw(8)<<"|"<<endl;
cout << "|"<<setw(8)<<"|"<<endl;
cout << "|"<<setw(4)<< "S" << setw(6)<<"S"<<setw(2)<<"|"<<endl;
cout << "|"<<setw(7)<<"6"<<"|"<<endl;
cout << "---------" << endl;
【问题讨论】:
-
您知道
endl会将您移至下一行,对吧?