Guest User

Untitled

a guest
Feb 22nd, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. typedef long long ll ;
  4. typedef unsigned long long ull ;
  5. #define pb push_back
  6. #define all(v) (v).begin(), (v).end()
  7. #define mp make_pair
  8. #define rep(i,a,b) for (int i = a; i < b; i++)
  9. #define FastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  10. void time ()
  11. {
  12. cout<<endl<<"Clock ticks: "<<clock()<<" Seconds: "<<(double)clock()/CLOCKS_PER_SEC*1000;
  13. }
  14. //-std=c++0x
  15.  
  16. #include <iostream>
  17. using namespace std;
  18.  
  19. int main() {
  20.  
  21. int x , s;
  22. int a = 0 , b = 0 ;
  23. int cnt = 1 ;
  24.  
  25. while (cin >> x && x)
  26. {
  27. a = 0 , b = 0 ;
  28. cnt = 1;
  29.  
  30. for ( int i = 0 ; i < 32 ; i++ )
  31. {
  32. s = ((x>>i)&1) ;
  33. if (s)
  34. {
  35. if (cnt%2 == 1)
  36. {
  37. a |= (1 << i) ; cnt ++;
  38. }else {
  39. b |= (1 << i) ; cnt ++ ;
  40. }
  41. }
  42. }
  43.  
  44. cout << a <<" " << b <<endl;
  45. }
  46.  
  47. return 0;
  48. }
Add Comment
Please, Sign In to add comment