头文件:<iomanip>
函数:setw(int n)
函数:setfill(char c)
cout<<setw(8)<<setfill('0')<<123<<endl;
输出:00000123
C语言
头文件: <stdio.h>
printf("%08d ",123);