位运算 x&(-x)
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
scanf("%d",&n);
while(n--){
int res = 0,x;
cin>>x;
while(x){
x -= x&(-x);
res++;
}
cout<<res<<" ";
}
puts("");
return 0;
}