Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int a, i, j = 0, x;
- cin >> a;
- i = 7;
- for(int c = 0; c <= 30; ++c) {
- x = ((a & i) >> c);
- if (x == 7) {
- j++;
- }
- i <<= 1;
- }
- cout << j;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement