Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- typedef long long ll ;
- typedef unsigned long long ull ;
- #define pb push_back
- #define all(v) (v).begin(), (v).end()
- #define mp make_pair
- #define rep(i,a,b) for (int i = a; i < b; i++)
- #define FastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
- void time ()
- {
- cout<<endl<<"Clock ticks: "<<clock()<<" Seconds: "<<(double)clock()/CLOCKS_PER_SEC*1000;
- }
- //-std=c++0x
- #include <iostream>
- using namespace std;
- int main() {
- int x , s;
- int a = 0 , b = 0 ;
- int cnt = 1 ;
- while (cin >> x && x)
- {
- a = 0 , b = 0 ;
- cnt = 1;
- for ( int i = 0 ; i < 32 ; i++ )
- {
- s = ((x>>i)&1) ;
- if (s)
- {
- if (cnt%2 == 1)
- {
- a |= (1 << i) ; cnt ++;
- }else {
- b |= (1 << i) ; cnt ++ ;
- }
- }
- }
- cout << a <<" " << b <<endl;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment