ioana_martin98

Untitled

May 12th, 2021
404
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. {
  5.     unsigned int n, p=0, i=0, x, k;
  6.     cin >> n;
  7.     for (k = 1; k <= n; k++)
  8.     {
  9.         cin >> x;
  10.         while (x != 0)
  11.         {
  12.             if (x % 10 % 2 == 0)
  13.                 p = p + 1;
  14.             else
  15.                 i = i + 1;
  16.             x = x / 10;
  17.         }
  18.     }
  19.     cout << p << ' ' << i;
  20.     return 0;
  21.  
  22. }
RAW Paste Data