出力されたテキストを画面の中央にフォーマットするコードを書くことは可能ですか? 私はたくさん試しましたが、何もうまくいきませんでした。ここまでで考えたこと。
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;
}