fork download
  1. #include <stdio.h>
  2.  
  3. int f(int a, int b) {
  4. if (a == 0 && b == 0)
  5. return 1;
  6. if (a != 0 && b == 0)
  7. return 0;
  8. if (a == 0 && b != 0)
  9. return 0;
  10. return f(a / 10, b / 10);
  11. }
  12.  
  13. int main() {
  14. int a, b;
  15. a = 110, b = 119, printf("%d, %d -> %s\n", a, b, (f(a, b)) ? "T" : "F");
  16. a = -110, b = -119, printf("%d, %d -> %s\n", a, b, (f(a, b)) ? "T" : "F");
  17. a = -110, b = 119, printf("%d, %d -> %s\n", a, b, (f(a, b)) ? "T" : "F");
  18. a = 1234, b = 214, printf("%d, %d -> %s\n", a, b, (f(a, b)) ? "T" : "F");
  19. a = 567, b = 23, printf("%d, %d -> %s\n", a, b, (f(a, b)) ? "T" : "F");
  20. a = 567, b = -23, printf("%d, %d -> %s\n", a, b, (f(a, b)) ? "T" : "F");
  21. a = 567, b = +23, printf("%d, %d -> %s\n", a, b, (f(a, b)) ? "T" : "F");
  22. return 0;
  23. }
  24. /* end */
  25.  
Success #stdin #stdout 0s 2248KB
stdin
Standard input is empty
stdout
110, 119 -> T
-110, -119 -> T
-110, 119 -> T
1234, 214 -> F
567, 23 -> F
567, -23 -> F
567, 23 -> F