Lucian_Adrian

#3664 cifparcifimp

Sep 21st, 2021
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. #include<iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6.  
  7. {
  8.  
  9. long long int n, k, p=0, i=0;
  10.  
  11. cin >> n;
  12.  
  13. for(int j=0; j<n;j++)
  14.  
  15. {
  16.  
  17. cin >> k;
  18.  
  19. while(k!=0)
  20.  
  21. {
  22.  
  23. if((k%10)%2==0)
  24.  
  25. p++;
  26.  
  27. else if((k%10)%2!=0)
  28.  
  29. i++;
  30.  
  31. k/=10;
  32.  
  33. }
  34.  
  35. }
  36.  
  37. cout << p << ' ' << i;
  38.  
  39. return 0;
  40.  
  41. }
  42.  
  43.  
Advertisement
Add Comment
Please, Sign In to add comment