fork(6) download
  1. #include<iostream>
  2. #include<cstdio>
  3. #include<cmath>
  4. using namespace std;
  5. int main()
  6. {
  7. unsigned int num,l,i;
  8. cin>>num;
  9. l=log10(num)+1;
  10. char ans[l+1];
  11. i=l-1;
  12. while(num>0 && i>=0)
  13. {
  14. ans[i--]=(char)(num%10+48);
  15. num/=10;
  16. }
  17. ans[l]='\0';
  18. cout<<ans<<endl;
  19. return 0;
  20. }
Success #stdin #stdout 0s 2688KB
stdin
012345
stdout
12345