Problem : Judge Status : AcceptedRunId : 5936443 Language : C Author : Code Render Status : Rendered By HDOJ C Code Render Version 0.01 Beta
1 #include2 int main() 3 { 4 int sum,cas,n; 5 scanf("%d",&cas); 6 while (cas--) 7 { 8 scanf("%d",&n); 9 sum=0;10 while (n)11 {12 sum+=(n&0x01);13 n>>=1;14 }15 printf("%d\n",sum);16 }17 return 0;18 }