Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cstdio>
- #include<cstring>
- #include<cmath>
- #include<cstdlib>
- #include<algorithm>
- #include<vector>
- #include<bitset>
- #include<set>
- #include<map>
- using namespace std;
- int main()
- {
- int n,a,b,c,t;
- while(scanf("%d",&n)&&n)
- {
- a=c=0,t=1;b=n;
- while(b)
- {
- //cout<<"b="<<b<<" a="<<a<<" t="<<t<<" c="<<c<<endl;
- if(b&1)
- {
- c++;
- if(c&1)a=a|t;
- }
- t=t<<1;
- b=b>>1;
- }
- b=n-a;
- printf("%d %d\n",a,b);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement