x-=lowbit(x) 减去1 才发现可以这么减 牛逼
```
include [HTML_REMOVED]
using namespace std;
int lowbit(int x)
{
return x&(-x);
}
int main()
{
int n;
cin>>n;
while(n–)
{
int x;
cin>>x;
int res= 0;
while(x) x-=lowbit(x),res++;
cout<<res<<” “;
}
return 0;
}```