如何从新行开始获得宽度,以便'Additional'在'For'下对齐?
char choice;
cout<<"Package A: For $39.99 per month, 4 gigabytes are provided.n"
<<setw(10)<<"Additional data costs $10 per gigabytes.";
return 0;
可以输出任意宽度的空字符串。像这样:
std::cout << "Package A: For $39.99 per month, 4 gigabytes are provided.n"
<< std::setw(11) << "" << "Additional data costs $10 per gigabytes.";