Roh*_*pit 2 c c++ return generic-programming output
int fn(unsigned int x) { int count = 0 ; for(; x!=0; x&=(x-1)) count ++; return count; }
我在编译器中尝试过,但无法弄清楚发生了什么.我认为这与位数有关x,但是什么?
x
Dre*_*ann 9
这有点戏法.:)
您将返回设置的位数1.
1
归档时间:
12 年,7 月 前
查看次数:
140 次
最近记录: