fork download
  1. #include <stdio.h>
  2. #include <limits.h>
  3. int foo(int x)
  4. {
  5. return x/8*3 + x%8*3/8;
  6. }
  7.  
  8.  
  9. int main(void) {
  10. printf("%d,%f\n%d,%f\n",foo(INT_MAX),INT_MAX*3.0/8.0,
  11. foo(INT_MIN),INT_MIN*3.0/8.0);
  12. // your code goes here
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0s 2156KB
stdin
Standard input is empty
stdout
805306367,805306367.625000
-805306368,-805306368.000000