cout控制输出

cout <<setfill('0') ;          //设置填充的字符

os << setw(9) << data[i];   //设置宽度为9

//这里填充0,如果data[i]=123,那么结果就是000000123
#include <iomanip> 

using std::setw;

using std::setfill;

头文件 #include <iomanip>  不能忘

你可能感兴趣的:(out)