题解 | #求int型正整数在内存中存储时1的个数#
求int型正整数在内存中存储时1的个数
http://www.nowcoder.com/practice/440f16e490a0404786865e99c6ad91c9
in_num = int(input()) er = 0 count = 0 while(in_num != 0): er = in_num % 2 if(er == 1): count += 1 in_num = (in_num - er)/2 print(count)