Răspuns:
Problema 1:
#include <iostream>
using namespace std;
int main()
{
int n, r = 1, d;
cin >> n;
while (n != 0)
{
r *= n % 10;
n /= 10;
}
cout << r;
return 0;
}
Problema 2:
#include <iostream>
using namespace std;
int main()
{
int n, r, nr_cif = 0;
cin >> n;
while (n != 0)
{
r = n % 10;
n /= 10;
++nr_cif;
}
cout << nr_cif;
return 0;
}
Explicație: