牛客464844775号
牛客464844775号
题解
题解 | #查找输入整数二进制中1的个数#
全部文章
题解
归档
标签
去牛客网
登录
/
注册
题解 | #查找输入整数二进制中1的个数#
2206 浏览
5 回复
2021-11-30
牛客464844775号
+关注
查找输入整数二进制中1的个数
http://www.nowcoder.com/practice/1b46eb4cf3fa49b9965ac3c2c1caf5ad
while True:
try:
n = int(input())
print(bin(n).count('1'))
except:
break
Python3
举报
收藏
赞 28
评论加载中...