#include <iostream>using namespace std;int main (){int y[10], n, i, max, min;cout<<"\n N="; cin>>n;for (i=0; i<n; i++)
{cout<<"\n Y["<<i<<"]=";cin>>y[i];}min=y[0];max=0;for (i=0; i<n; i++) { if ( max<y[i] ) { max = y[i]; } if ( min>y[i] ) { min = y[i]; }}cout << "Summa max i min = " << max+min << endl;system("pause");return 0;}
#include <iostream>
using namespace std;
int main ()
{
int y[10], n, i, max, min;
cout<<"\n N="; cin>>n;
for (i=0; i<n; i++)
{
cout<<"\n Y["<<i<<"]=";
cin>>y[i];
}
min=y[0];
max=0;
for (i=0; i<n; i++) {
if ( max<y[i] )
{
max = y[i];
}
if ( min>y[i] )
{
min = y[i];
}
}
cout << "Summa max i min = " << max+min << endl;
system("pause");
return 0;
}