# include <stdio.h> int main() { int number; while (scanf("%d", &number) != EOF) { int count = 0; for (int i = 0; i < 31; i++) { if ((number & 1) == 1) count++; number >>= 1; } printf("%d\n", count); } }</stdio.h>
点赞

相关推荐

刷牛客的我很豁达:你是不是对算法有什么误解,你没手握两篇顶刊顶会,还想搞算法岗,有顶刊顶会在算法岗算才入门
点赞 评论 收藏
分享
09-30 14:33
Python
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务