标签:
public class Solution { public int HammingWeight(uint n) { int count; for (count=0; n > 0 ; count++){ n &= n-1; } return count; } }
LeetCode -- Number of 1 Bits
原文地址:http://blog.csdn.net/lan_liang/article/details/49962407