https://www.patest.cn/contests/pat-b-practise/1042
#include "stdio.h"
int main()
{
int i, max = 0, k, num[26] = {0};
char ch;
while(scanf("%c", &ch) && ('\n' != ch))
{
if((ch >= 65) && (ch <= 90))
++num[ch - 65];
else if((ch >= 97) && (ch <= 122))
++num[ch - 97];
}
for(i = 0; i < 26; ++i)
if(max < num[i])
{
max = num[i];
k = i;
}
printf("%c %d\n", 'a' + k, max);
return 0;
}