#include
#include
using namespace std;
int main() {
int n,mx,mn;
cout<<"n = "; cin>>n;
int a[n];
cout<<"massiv: ";<br> cin>>a[0];
mn=a[0]; mx=a[0];
for (int i=1; i cin>>a[i];
if (a[i]>mx) mx=a[i];
if (a[i] }
a[0]=mx; a[n-1]=mn;
cout<<"new massiv: ";<br> for (int i=0; i cout<<endl;<br> system("pause");
return 0;
}
n = 5
massiv: 15 -13 27 45 14
new massiv: 45 -13 27 45 -13