// about setw() #include <iostream> #include <iomanip> #include <cstring> using namespace std; int main() { string name = "wangyang"; // generate a string cout << setiosflags(ios::right) << setfill('a') << setw(20) << name << endl; // control the word count, the alignment, the fill return 0; }
关于 setw() 函数(C++)
猜你喜欢
转载自www.cnblogs.com/zijidefengge/p/12094337.html
今日推荐
周排行