fork download
  1. #define p(x) printf("%i",x);
  2. i,y,h;
  3. f(x){
  4. for(i=y=x;(i-=h)>=0;){
  5. p(y--)
  6. h=floor(log10(y))+1;
  7. }
  8. if(i+=h)
  9. p(h=floor(y/pow(10,i)))
  10. p(x)
  11. }
  12.  
  13. n;main(){
  14. scanf("%i",&n);
  15. f(n);
  16. }
Success #stdin #stdout 0s 2160KB
stdin
99
stdout
9998979695949392919089888786858483828180797877767574737271706968676665646362616059585756555453525150499