Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main()
- {
- long long int n, k, p=0, i=0;
- cin >> n;
- for(int j=0; j<n;j++)
- {
- cin >> k;
- while(k!=0)
- {
- if((k%10)%2==0)
- p++;
- else if((k%10)%2!=0)
- i++;
- k/=10;
- }
- }
- cout << p << ' ' << i;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment