c++输出对齐函数 setw()

int a=10;  // 也能够是string a string b   字符串对齐的代码和int型实际上是同样的,底下都不改,输出的格式也会右对齐,已经尝试过  int b=20;  cout.setf(ios::right,ios::adjustfield);  cout.fill('0');  cout << setw(5) << a <<endl;  cout << setw(5) <<
相关文章
相关标签/搜索