Skip to content

Commit

Permalink
11933 solve
Browse files Browse the repository at this point in the history
  • Loading branch information
ksaveljev committed May 29, 2011
1 parent 2f4e284 commit 63a3ad8
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions 11933.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#include <iostream>
using namespace std;

int main(void) {
unsigned int n, a, b;

while (cin >> n) {
if (n == 0)
break;

a = 0;
b = 0;
int counter = 0;

for (int i = 0; i < 31; i++) {
if ((n & (1<<i)) != 0) {
if (counter % 2 == 0) {
a |= 1 << i;
} else {
b |= 1 << i;
}

counter++;
}
}

cout << a << " " << b << endl;
}

return 0;
}

0 comments on commit 63a3ad8

Please sign in to comment.