标签:
#include <iostream> using namespace std; int main() { int n; cin >> n; int count = 0; while(n) { n = n&(n-1); count++; } cout << count << endl; return 0; }
统计数中二进制表达式中1的个数
原文地址:http://www.cnblogs.com/zyqBlog/p/5962377.html