Răspuns:
#include <iostream.h>
#include <stdio.h>
using namespace std;
int main()
{
int a[50],n,s=0,p=1,i;
cout<<"n=";
cin>>n;
for(i=1;i<=n;i++)
{
cin>>a[i];
if(a[i]<0)
p=p*a[i];
else
s=s+a[i];
}
cout<<"s="<<s<<"p="<<p;
return 0;
}
//sper sa iti fie de folos