int hammingWeight(uint32_t n) {
int ret=0;
while(n){
if(n & 1)
ret++;
n >>= 1;
}
return ret;
}
LeetCode-191-位1的个数-C语言
猜你喜欢
转载自blog.csdn.net/weixin_36094222/article/details/90206212
今日推荐
周排行