yama #7168(2008/08/17 15:44 GMT) [ C++ ] Rating0/0=0.00
標準入力に対応させてみました
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#include <iostream> #include <cstdlib> #include <cstring> void func(int m, int n = 0) { char buf[BUFSIZ]; int i = 1; int size = ::strlen(::itoa(n, buf, 10)) - 1; std::cout << n << std::endl; while(size--) i *= 10; if(m > n) return func(m, n+i); } int main(int argc, char* argv[]) { argc == 2 ? func(::atoi(argv[1])) : func(300); }
Rating0/0=0.00-0+
[ reply ]
yama #7168() [ C++ ] Rating0/0=0.00
標準入力に対応させてみました
Rating0/0=0.00-0+
[ reply ]