AC
int main() { int n,N; scanf(“%d”,&N); for(n=0;n<N;n++){ int x; int n=0,m=0; int d; scanf(“%d”,&x); while(1){ d=x%2; if(d==1){ n++; } x=(x-d)/2; if(d==0) m++; if(x==0)break; } printf(“%d %d\n”,m,n); } return 0; }
AC
include
include
int main()
{
int n,N;
scanf(“%d”,&N);
for(n=0;n<N;n++){
int x;
int n=0,m=0;
int d;
scanf(“%d”,&x);
while(1){
d=x%2;
if(d==1){
n++;
}
x=(x-d)/2;
if(d==0)
m++;
if(x==0)break;
}
printf(“%d %d\n”,m,n);
}
return 0;
}