题目描述
blablabla
样例
class Solution {
public:
int NumberOf1(int n) {
int res = 0;
unsigned int u = n;
for(int i = 31;i >= 0;i--)
{
if(u >> i & 1)
res++;
}
return res;
}
};