Lucian_Adrian

Untitled

Aug 11th, 2021
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int main()
  5. {
  6. int n,a,b,c;
  7. cin >> n;
  8. a=n/100;
  9. b=(n%100)/10;
  10. c=(n%100)%10;
  11. if (a%2==1 && b%2==1 && c%2==1)
  12. cout << 3;
  13. else if ((a%2==1 && b%2==1) || (a%2==1 && c%2==1) || (c%2==1 && b%2==1))
  14. cout << 2 ;
  15. else if (a%2==1 || b%2==1 || c%2==1)
  16. cout << 1;
  17. else
  18. cout << 0;
  19.  
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment