fork(2) download
  1. #include <cstdio>
  2.  
  3. int f(int x)
  4. {
  5. return !(x & 8) == (x & 1) | 0x1e ^ !(x - 2) << 1;
  6. }
  7.  
  8. int main()
  9. {
  10. for(int i = 1; i <= 12; i++)
  11. std::printf("%d %d\n", i, f(i));
  12. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
1 31
2 28
3 31
4 30
5 31
6 30
7 31
8 31
9 30
10 31
11 30
12 31