摘要: int nbit(int num) { int ans = 0; while(num) { num = (num - 1) & num; ans ++; } return ans; } 阅读全文