提交时间:2022-04-09 14:24:27
运行 ID: 48144
#include<bits/stdc++.h> using namespace std; int n,a[110]; int main(){ scanf("%d",&n); for(int i=1;i<=n;i++) scanf("%d",&a[i]); if(n%2==0) printf("%d\n",min(a[1],a[n])); else printf("%d\n",max(a[1],a[n])); return 0; }