Lucian_Adrian

https://www.pbinfo.ro/probleme/3667/cifmaximp

Oct 19th, 2021
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int n, i, x, maxim, sol;
  4. int main () {
  5. cin>>n;
  6. for (i=1;i<=n;i++) {
  7. cin>>x;
  8. maxim = 0;
  9. while (x!=0) {
  10. if (x%10 > maxim)
  11. maxim = x%10;
  12. x /= 10;
  13. }
  14. if (maxim%2 == 1)
  15. sol++;
  16. }
  17. cout<<sol;
  18. return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment