其他分享
首页 > 其他分享> > 191. Number of 1 Bits

191. Number of 1 Bits

作者:互联网

!!!题目地址!!!

int hammingWeight(uint32_t n) {
	int total = 0;
	for (int i = 0; i < 32; i++) {
		total += (n & 1);
		n = n >> 1;
	}
	return total;
}

标签:int,32,191,Number,++,total,Bits
来源: https://www.cnblogs.com/realms/p/16283060.html