选取端点的最大值
#include <iostream>
#include<string>
#include<algorithm>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
string s;
cin >> n >> s;
char c=max(s[0],s[n-1]);
cout << c<< '\n';
return 0;
}

京公网安备 11010502036488号