fork(1) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6. unsigned long int k;
  7. while (cin >> k) {
  8. cout << (k ^ (k >> 1)) << endl;
  9. }
  10. return 0;
  11. }
Success #stdin #stdout 0s 15232KB
stdin
3
14
5
12
stdout
2
9
7
10