InnaSibirova

111

Nov 9th, 2019
304
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4. int a, i, j  = 0, x;
  5. cin >> a;
  6. i = 7;
  7. for(int c = 0; c <= 30; ++c) {
  8.     x = ((a & i) >> c);
  9.     if (x == 7) {
  10.         j++;
  11.     }
  12.     i <<= 1;
  13.    
  14.  
  15. }
  16. cout << j;
  17. }
RAW Paste Data