nyoj 100

  怒刷水题。。。

  AC代码:

#include <stdio.h>
int main()
{
    int x,t,count;
    scanf("%d",&t);
    while(t--)
    {
        count=0;
        scanf("%d",&x);
        for(; x!=0;x>>=1)
            count+=(x&1);
        printf("%d
",count);
    }
	return 0;
}

  

原文地址:https://www.cnblogs.com/darkchii/p/9164520.html