In problema ta nu cunosti numarul de pasi (e de forma while sau do...while). Ti-am facut o sursa C++ cu instructiunea do...while. Succes!
#include <iostream>
using namespace std;
int x, ct, k, p = 1, s = 0;
int main()
{
do
{
cin >> x;
k ++;
if (x != 0 && k % 2 == 1) p = p * x, ct ++;
if (x != 0 && k % 2 == 0) s = s + x, ct ++;
} while (x != 0);
if (ct == 0) cout << "NU EXISTA";
else
{
cout << p << " " << s;
}
return 0;
}