problem
solution
codes
#include<iostream>
using namespace std;
int main(){
unsigned int n, x;
while(cin>>n &&n){
x = n&-n;
cout<<(n+x+(n^(n+x))/x/4)<<"
";
}
return 0;
}
#include<iostream>
using namespace std;
int main(){
unsigned int n, x;
while(cin>>n &&n){
x = n&-n;
cout<<(n+x+(n^(n+x))/x/4)<<"
";
}
return 0;
}