fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3. int main(void) {
  4. int a = 1234;
  5. int b = 45678;
  6. int c = 0;
  7.  
  8. while(a || b)
  9. {
  10. if (b)
  11. {
  12. int m = pow(10, (int)log10(b));
  13. c=c*10 + b/m;
  14. b = b%m;
  15. }
  16. if (a)
  17. {
  18. int m = pow(10, (int)log10(a));
  19. c=c*10+a/m;
  20. a = a%m;
  21. }
  22. }
  23. printf("Result: %d\n", c);
  24. return 0;
  25. }
  26.  
Success #stdin #stdout 0s 4692KB
stdin
Standard input is empty
stdout
Result: 415263748