#include <iostream>
#include <iomanip>
int frameCount = ;
while(){
stringstream buf;
buf <<setfill('') << setw()<< frameCount;
string num = buf.str();
frameCount++; } for(int i=; i < ; i++)
{
cout << setfill('') << setw() << i << endl;
}

参考 http://stackoverflow.com/questions/2999016/print-numbers-sequentially-using-printf-with-filling-zeroes

04-13 16:27