👤

Se dau n numere. Sa se afle suma acestor nr pare

Răspuns :

int main()
{int n,s=0,p=1,x;
cin>>n;
for(int i=1;i<=n;i++)
{f>>x;
if(x%2==0)
s+=x;
else
p*=x;
}
cout<<"Suma = "<<s<<" iar produsul = "<<p;
return 0;
}
#include using namespace std; int main() {int n, x, s=0; cin>>n; while(n!=0) {cin>>x; if(x%2==0) s=s+x; } cout<