获取二进制中1的个数
int number_of_1(int n)
{
int count = 0;
while(n)
{
count++;
n = n & (n - 1);
}
return count;
}
int number_of_1(int n)
{
int count = 0;
while(n)
{
count++;
n = n & (n - 1);
}
return count;
}