标签:c
#include<stdio.h>
int main()
{
int num;
int s=0,yus=0,count=0;
printf("请输入一个数字:");
scanf("%d",&num);
for(s=num;s>=1;)
{
yus=s%2;
s=s/2;
if (yus==1)
{
count++;
}
}
printf("%d\n",count);
return 0;
}
标签:c
原文地址:http://w2558213.blog.51cto.com/10800718/1704238