标签:include namespace mat amp space names ret style class
#include<cmath> #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; int main(void) { int t; while(~scanf("%d",&t)) { while(t--) { int n; scanf("%d",&n); int cnt = 0; while(n) { if(n%2==0) { n = n / 2; } else { cnt++; n = n - 1; } } printf("%d\n",cnt); } } return 0; }
标签:include namespace mat amp space names ret style class
原文地址:https://www.cnblogs.com/AC-AC/p/9739615.html