Răspuns :
Salut!
Ai rezolvarea mai jos
C++
#include <iostream>
using namespace std;
int main()
{
int n, num0 = 0, numpar = 0, numimpar = 0;
cin >> n;
while (n != 0)
{
int c = n % 10;
if (c == 0)
{
num0++;
}
else if (c % 2 == 0)
{
numpar++;
}
else
{
numimpar++;
}
n = n / 10;
}
cout << num0 << " " << numpar << " " << numimpar;
return 0;
}
PSEUDOCOD
start
natural n, c, num0, numpar, numimpar
citeste n
num0 <- 0
numpar <- 0
numimpar <- 0
cat_timp n != 0
c <- n mod 10
daca c = 0
num0 <- num0 + 1
altfel_daca c mod 2 = 0
numpar <- numpar + 1
altfel
numimpar <- numimpar + 1
sfarsit_daca
n <- n div 10
sfarsit_cat_timp
scrie num0 " " numpar " " numimpar
stop