Advertisement
Josif_tepe

Untitled

Mar 19th, 2021
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int n;
  8.     int m;
  9.     int k;
  10.     int cifri_na_broj;
  11.     int kolku_broevi = 0;
  12.     int kolku_cifri = 0;
  13.     cin >> n;
  14.     int niza[n];
  15.     for (int i = 0; i <= n-1; i += 1)
  16.     {
  17.         cin >> niza[i];
  18.         cifri_na_broj = 0;
  19.         k = 0;
  20.         while (niza[i] > 0)
  21.         {
  22.             m = niza[i] % 10;
  23.             niza[i] /= 10;
  24.             if (m % 2 == 0)
  25.             {
  26.                 k += 1;
  27.             }
  28.             cifri_na_broj += 1;
  29.         }
  30.         if (k == cifri_na_broj)
  31.         {
  32.             kolku_broevi += 1;
  33.             kolku_cifri += cifri_na_broj;
  34.         }
  35.  
  36.     }
  37.     cout << kolku_broevi << endl;
  38.     cout << kolku_cifri << endl;
  39.     return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement