找到字符串中最大的字符,答案即为它和'a'的差加上1
- #include
- using namespace std;
- #define rep(i,a,n) for(int i = a;i
- #define per(i,a,n) for(int i = n-1;i>=a;i--)
- #define pb push_back
- #define mp make_pair
- #define eb emplace_back
- #define all(x) (x).begin(),(x).end()
- #define fi first
- #define se second
- #define SZ(x) ((int)(x).size())
- #define yes cout<<"YES"<<'\n';
- #define no cout<<"NO"<<'\n';
- #define endl '\n';
- typedef vector<int> VI;
- typedef long long ll;
- typedef unsigned long long ull;
- typedef pair<int,int> PII;
- typedef double db;
- mt19937 mrand(random_device{}());
- const ll mod=1000000007;
- int rnd(int x) {return mrand() % x;}
- ll gcd(ll a,ll b){return b?gcd(b,a%b):a;};
- ll lcm(int a,int b){return a*b/gcd(a,b);}
-
- int T;
- string s;
- int n;
-
- void solve(){
- cin>>n>>s;
- char mx=*max_element(all(s));
- cout<
'a'+1< - }
-
- int main(){
- ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
- cin>>T;
- while(T--){
- solve();
- }
- return 0;
- }