fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int a = 0;
  5. scanf("%d", &a);
  6. a = (a < 0) ? -a : a;
  7.  
  8. while (a) {
  9. putchar((a % 10) + '0');
  10. a /= 10;
  11. }
  12.  
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0s 2160KB
stdin
-123
stdout
321