👤

problema #3664 cifparcifimp de pe pbinfo

Răspuns :

Răspuns:

#include <iostream>

using namespace std;

int main()

{

int n , x,cif_i,cif_p;

cif_i=0;

cif_p=0;

cout<<"n=";

cin>>n;

for(int i=1;i<=n;i++)

{

 cin>>x;

 while(x)

 {

  int cifra=0;

  cifra=x%10;

  if(cifra%2==0)

   cif_p++;

  else

   cif_i++;

  x/=10;

 }

}

cout<<cif_p<<" "<<cif_i;

}

Explicație: