标签:
1 int func(int x){ 2 int countx = 0; 3 while(x){ 4 countx ++; 5 x = x & (x-1); 6 } 7 return countx; 8 }
计算二进制数中1的个数
原文地址:http://www.cnblogs.com/yingl/p/5815484.html