Răspuns:
#include <iostream>
using namespace std;
int main()
{
int V[50],n,maxim,minim;
cin>>n;
for(int i=0;i<=n-1;i++)
{
cin>>V[i];
}
for(int i=0;i<=n-1;i++)
{
if(i==0)
{
maxim = V[i]; minim = V[i];
}
else
{
if(V[i] >= maxim) {maxim = V[i];}
if(V[i] <= minim) {minim = V[i];}
}
}
cout<<"max negative="<<minim<<endl;
cout<<"min pozitive="<<maxim;
}