复制代码

int func(x) 

int countx =0; 
while(x) 

countx ++; 
x = x&(x-1); 

return countx; 
}
假定x = 9999。 答案:8
复制代码