C++
1.
#include <iostream>
using namespace std;
int main()
{
int x, p=1;
cin >> x;
while (x!=0)
{
p=p*x;
cin >> x;
}
cout << p;
return 0;
}
2.
#include <iostream>
using namespace std;
int main()
{
int n, nr=0;
cin >> n;
while (n!=0)
{
nr++;
n=n/10;
}
cout << nr;
return 0;
}
Pseudocod
1.
x, p intregi
p <- 1
citeste x
cat timp x!=0 executa
{
p <- p * x
citeste x
}
scrie p
2.
n, nr intregi
citeste n
nr <- 0
cat timp n!=0 executa
{
nr <- nr + 1
n <- n/10
}
scrie nr