Monthly Archives: March 2008

群硕笔试第一题

2008-03-31 10:37 / Software / no comment / 6 views /

计算一个整数中有多少个”1″

int count ( int i )
{
int count = 0;
while( i!=0 )
{
i = i&(i-1);
count++;
}[......]

more…