题解
2025-01-06 22:13:44
发布于:广东
1阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
char s[101];
char b[26]{'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
int a[26];
int main(){
cin>>s;
int n = strlen(s);
for(int j=0;j<n;j++){
for(int i=0;i<26;i++)if(s[j]==b[i])a[i];
}
int x=a[0];
char x1=127;
for(int i=0;i<26;i)if(a[i]>x)x=a[i];
for(int i=0;i<26;i++)if(a[i]==x&&b[i]<x1)x1=b[i];
cout<<x1;
return 0;
}
这里空空如也
有帮助,赞一个