fork download
  1.  
  2. #include <stdio.h>
  3.  
  4. int main(int argc, char* argv[])
  5. {
  6. int x, x3, x2, x1, x0;
  7. int y, y1, y0;
  8.  
  9. for (x = 0; x < 9; x++)
  10. {
  11. x3 = (x >> 3) & 1;
  12. x2 = (x >> 2) & 1;
  13. x1 = (x >> 1) & 1;
  14. x0 = x & 1;
  15.  
  16. y0 = (~x3) & x1 & ((x2 & x0) | (~x2));
  17. y1 = (~x3) & ((x2 & x1 & (~x0)) | ((~x1) & x0));
  18. y = (y1<<1) | y0;
  19. printf("%i\n",y);
  20. }
  21.  
  22. return 0;
  23. }
Success #stdin #stdout 0.02s 2680KB
stdin
Standard input is empty
stdout
0
2
1
1
0
2
2
1
0