fork(1) download
  1. #include <iostream>
  2. #include <bitset>
  3. using namespace std;
  4.  
  5. int main() {
  6. int a[] = {0x303,0x030,0,0,0x2fd};
  7. int x = 0;
  8. bitset<12> b;
  9. for(int ai: a) {
  10. x = x ^ ai;
  11. b = x;
  12. cout << b.to_string(' ', 'W') << '\n';
  13. }
  14. return 0;
  15. }
Success #stdin #stdout 0s 4388KB
stdin
Standard input is empty
stdout
  WW      WW
  WW  WW  WW
  WW  WW  WW
  WW  WW  WW
   WWW  WWW