fork(2) download
  1. #include <stdio.h>
  2.  
  3. d(n){printf("%d,%d",n+2&3?n+2&4?-1:1:0,n&3?n&4?-1:1:0);}
  4.  
  5. int main( void )
  6. {
  7.  
  8. for( int n = 0 ; n <= 7 ; n++ )
  9. {
  10. d(n);
  11. puts("");
  12. }
  13.  
  14. }
  15.  
Success #stdin #stdout 0s 9432KB
stdin
Standard input is empty
stdout
1,0
1,1
0,1
-1,1
-1,0
-1,-1
0,-1
1,-1