fork download
  1. #include <stdio.h>
  2. int isGreater(int x, int y){
  3. y = ~y;
  4. return !(((x&y) + ((x^y) >> 1)) >> 31);
  5. }
  6. int main(){
  7. printf("%d %d %d\n",isGreater(1,1), isGreater(0,1), isGreater(1,0));
  8. return 0;
  9. }
Success #stdin #stdout 0s 2248KB
stdin
Standard input is empty
stdout
0 0 1