/*******************************************************************************
* Author : liweimin90
* Email : liweimin90@qq.com
* Last modified : 2013-08-08 16:24
* Filename : test.cpp
* Description :
* *****************************************************************************/
#include
#include
using namespace std;
class strnum{
public:
string str;
strnum(){
str = "0";
}
strnum(string rstr){
str = rstr;
}
string inc(){
if(*str.rbegin() == '9'){
if(str.size() == 1){
str = "10";
}else{
str = strnum(str.substr(0, str.size() - 1)).inc() + "0";
}
}else{
*str.rbegin() += 1;
}
return str;
}
void printnum(){
cout << str << endl;
}
};
int main(){
int a = 10001;
strnum num;
while(a--){
num.printnum();
num.inc();
}
return 0;
}
阅读(1325) | 评论(0) | 转发(0) |