提交时间:2020-08-23 19:13:26
运行 ID: 6054
#include <bits/stdc++.h> using namespace std; int n; int a; int s1,s2; int main() { cin>>n; for(int i=1; i<=n; i++) { s1=0; s2=0; cin>>a; while(a>0) { if(a%2==1)s1++; else s2++; a=a/2; } cout<<s1<<' '<<s2<<endl; } return 0; }