Problem : 2568 ( 前进 ) Judge Status : Accepted
RunId : 5936443 Language : C Author : qq1203456195
Code Render Status : Rendered By HDOJ C Code Render Version 0.01 Beta
RunId : 5936443 Language : C Author : qq1203456195
Code Render Status : Rendered By HDOJ C Code Render Version 0.01 Beta
1 #include <stdio.h> 2 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 }