提交时间:2022-04-10 13:56:26
运行 ID: 48181
#include <bits/stdc++.h> using namespace std; int a[110]; int main() { // freopen("game.in","r",stdin); // freopen("game.out","w",stdout); int n; cin>>n; for(int i=1;i<=n;++i) cin>>a[i]; if(n&1) cout<<max(a[1],a[n])<<'\n'; else cout<<min(a[1],a[n])<<'\n'; return 0; }