是否可以编写代码使我输出的文本格式化到屏幕中间?我已经尝试了很多,但没有任何效果。这是我到目前为止所想到的。
cout.setf (ios::middle);
那是一个错误。我也试过
setw(10);//etc.
但是我对使用 setw 命令有点陌生,所以我不知道如何正确使用它。
更新:
//The Game of 4 Seasons
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
int main()
{
cout << "Welcome to this game\n\n\n";
system ("pause");
system ("cls");
cout << "CAUTION!\n\n";
cout << "The adventure you are about to embark contains high levels of:\n";
cout << "Fun\n";
cout << "Adventure\n";
cout << "Excitement\n\n\n";
cout << "If you have a record of buzz killing or anything similar, \nthen this game is NOT for you.\n\n\n\n";
system ("pause");
return 0;
}