C++ cout setw()
integer width cout modifiers
#include <iostream> using namespace std; #include <iomanip.h> int main()//from w ww. jav a2s . com { cout << 456 << 456 << 456 << "\n"; cout << setw(5) << 456 << setw(5) << 456 << setw(5) << 456 << "\n"; cout << setw(7) << 456 << setw(7) << 456 << setw(7) << 456 << " \n"; return 0; }