二进制中1的个数
public int NumberOf1(int n) { int count = 0; while (n!=0) { n = n&(n-1); count++; } return count; }
posted on 2019-02-25 20:47 www_practice 阅读(93) 评论(0) 编辑 收藏 举报
public int NumberOf1(int n) { int count = 0; while (n!=0) { n = n&(n-1); count++; } return count; }
posted on 2019-02-25 20:47 www_practice 阅读(93) 评论(0) 编辑 收藏 举报