fork download
  1. #include <stdio.h>
  2. #include <limits.h>
  3.  
  4.  
  5. int result(int value)
  6. {
  7. return (!(~value))*1535;
  8. }
  9.  
  10. void check(int input, int expected)
  11. {
  12. if (result(input) != expected)
  13. printf("Result was %d for input %d (expected: %d)\n", result(input), input, expected);
  14. }
  15.  
  16. int main()
  17. {
  18.  
  19. for (int i = INT_MIN; i > -1; ++i)
  20. check(i, 0);
  21. for (int i = 0; i < INT_MAX; ++i)
  22. check(i, 0);
  23.  
  24. check(INT_MAX, 0);
  25. check(-1, 1535);
  26. }
Success #stdin #stdout 0s 5560KB
stdin
Standard input is empty
stdout
Standard output is empty