关于 setw() 函数(C++)

// about setw()
#include 
#include 
#include 


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++)_第1张图片

你可能感兴趣的:(关于 setw() 函数(C++))