#include <bits/stdc++.h>
using namespace std;
long long a[1000],n,i,ln,nn;
int main()
{
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
for (i=1; i<=n; i++)
cout<<a[i]<<" ";
cout<<endl;
ln=a[1];
nn=a[1];
for (i=2; i<=n; i++)
{
ln=max(ln,a[i]);
nn=min(nn,a[i]);
}
cout<<ln<<endl;
cout<<nn;
return 0;
}
Đúng 2
Bình luận (0)