Răspuns:
#include <iostream>
#include <fstream>
#include <math.h>
using namespace std;
int main()
{int v[100],n,i,s=0,p=1;
cout<<"n=";cin>>n;
for(i=1;i<=n;i++)
{
cout<<"v["<<i<<"]=";
cin>>v[i];
}
for(i=1;i<=n;i++)
if(v[i]>0)
s=s+v[i];
else
if(v[i]<0)
p=p*v[i];
cout<<"Suma este : "<<s;
cout<<endl;
cout<<"Produsul este : "<<p;
}