直接模拟找最大值,然后int ans=tmax^a[n],cout<<ans;
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 110;
int n,t=-100;
int a[N];
int main()
{
cin>>n;
for(int i=1;i<=n;i++) cin>>a[i],t=max(t,a[i]);
int ans=t^a[n];
cout<<ans;
}