fork download
  1. int f(int n) /* Treats numbers in the range 0XC0000000 to 0X3FFFFFFF as valid to
  2.   generate f(f(x)) equal to -x. If n is within this range, it will
  3.   project n outside the range. If n is outside the range, it will
  4.   return the opposite of the number whose image is n. */
  5. {
  6. return n ? n > 0 ? n <= 0X3FFFFFFF ? 0X3FFFFFFF + n : 0X3FFFFFFF - n :\
  7. n >= 0XC0000000 ? 0XC0000000 + n : 0XC0000000 - n : 0;
  8. }
  9.  
  10. int main()
  11. {
  12. int n = 5;
  13. printf( "f(f(%d)) = %d\n", n, f(f(n)) );
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0.02s 1720KB
stdin
Standard input is empty
stdout
f(f(5)) = -5