fork download
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <cmath>
  4. #include <cstdlib>
  5.  
  6.  
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11. int n = 125521;
  12. int d = floor(log10(n));
  13. printf("%d Digits\n",d+1);
  14. int t =0;
  15. while(floor(log10(n))-t)
  16. { printf("%d-----%d\n",(n/(int)pow(10,floor(log10(n))-t)%10),t); t++;}
  17. return 0;
  18. }
Success #stdin #stdout 0s 3140KB
stdin
Standard input is empty
stdout
6 Digits
1-----0
2-----1
5-----2
5-----3
2-----4