题目链接:http://ybt.ssoier.cn:8088/problem_show.php?pid=1187
#include <iostream>
#include <string>
using namespace std;
int bucket[30];
int main()
{
string s;
cin >> s;
for (auto x : s)
{
bucket[x - 'a']++;
}
int maxx = -1, idx = -1;
for (int i = 0; i < 26; i++)
{
if (bucket[i] > maxx)
{
maxx = bucket[i];
idx = i;
}
}
cout << char(idx + 'a') << " " << maxx << endl;
return 0;
}