daily pastebin goal
64%
SHARE
TWEET

Untitled

a guest Mar 20th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     int x;
  7.     cin >> x;
  8.     int res = 0;
  9.     for (int i = 0; i < 32; ++i)
  10.         if ((1 << i) & x)
  11.             res++;
  12.     cout << res;
  13.     return 0;
  14. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top