题目:https://pintia.cn/problem-sets/994805260223102976/problems/994805280817135616
#include<iostream>
#include<vector>
#include<string>
#include<cctype>
using namespace std;
int main()
{
string s;
getline(cin, s);
int res[123];
for(int i=0;i<123;i++)
res[i]=0;
int len = s.length();
for (int i = 0;i < len;i++)
{
if (isalpha(s[i]))
{
s[i] = tolower(s[i]);
for (int j = 97;j < 123;j++)
{
if (s[i] == j)
res[j]++;
}
}
}
int max = 122;
for (int i = 122;i>=97;i--)
{
if (res[i]>=res[max])
{
max = i;
}
}
char k=max;
printf("%c %d", k, res[max]);
return 0;
}