标签:
public class Solution { public int NumberOf1(int n) { int count = 0; int one = 1; while(one!=0){ if((one & n)!=0){ count++; } one = one << 1; } return count; } }
二进制中1的个数
原文地址:http://www.cnblogs.com/hesier/p/5582926.html