fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define endl "\n"
  4. #define int long long
  5. #define faster() ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
  6. #define mod 1000000007
  7. #define maxN 10005
  8. void solve(){
  9. int x ; cin >> x ;
  10. cout << __builtin_popcount(x);
  11. }
  12.  
  13. signed main(){
  14. faster();
  15. int test = 1 ;
  16. // cin >> test;
  17. while(test--){
  18. solve();
  19. }
  20. }
Success #stdin #stdout 0.01s 5280KB
stdin
8
stdout
1