Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //213
- #include <iostream>
- #include <cstdio>
- using namespace std;
- int main(void) {
- ios_base::sync_with_stdio(false);
- cin.tie(NULL);
- freopen("input.txt", "r", stdin);
- freopen("output.txt", "w", stdout);
- int n, cnt = 0;
- cin >> n;
- for (; n != 0; n >>= 1)
- if (n % 2 != 0)
- ++ cnt;
- cout << cnt;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement