Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|---|
5514 | 老师 | 统计1和0的个数 | C++ | Accepted | 100 | 5 MS | 248 KB | 237 | 2020-08-14 11:01:13 |
#include<bits/stdc++.h> using namespace std; int main(){ int n,m,c1,c0; cin>>n; while(n--){ c0=0,c1=0; cin>>m; while(m!=0){ if(m%2) c1++; else c0++; m/=2; } cout<<c1<<" "<<c0<<endl; } return 0; }