#include<iostream> using namespace std; int main() { int n; int count = 0; while(cin >> n) { while(n){ if(n%2) { count++; n = n/2; }else{ n = n/2; } } } cout<<count<<endl; return 0; }
#include<iostream> using namespace std; int main() { int n; int count = 0; while(cin >> n) { while(n){ if(n%2) { count++; n = n/2; }else{ n = n/2; } } } cout<<count<<endl; return 0; }