登 录
int BitCount(int n) { int count = 0; while (n) { count ++; n &= n-1; // 去年二进制中末位的1 } return count; }
抱歉!评论已关闭.