Răspuns:
#include <iostream>
using namespace std;
int main()
{
int n,i,min,max,s=0,p=1,a[7];
cin>>n;
for(i=1;i<=n;i++)
{
cin>>a[i];
s+=a[i];
p*=a[i];
}
min=max=a[1];
for(i=1;i<=n;i++)
{
if(max<a[i]) max=a[i];
if(min>a[i]) min=a[i];
}
cout<<min<<" "<<max<<" "<<s<<" "<<p;
}
Explicație: