求一个数转化成二进制后包含1的个数
1 int func(int x){ 2 int count=0; 3 while(x){ 4 count++; 5 x=x&(x-1); 6 } 7 return count; 8 }