摘要: 问题:给定一个无符号整型的对象,统计其二进制序列中1的个数? 遍历: unsigned bit_count(unsigned x) { unsigned result=0; while(x){ result+=x&01?1:0; x>>=1; } return result; } 位运算: unsi 阅读全文
posted @ 2021-01-11 18:31 新望 阅读(98) 评论(0) 推荐(0)