https://pintia.cn/problem-sets/994805260223102976/problems/994805280817135616
思路
计数法,遇到字母就统计,大写的话就转成小写字母统计,否则直接统计。用ctype里的函数比较方便
#include <stdio.h>
#include <ctype.h>
int main()
{
int asc[128]= {0};
char c;
while((c=getchar())!='\n') {
c = isalpha(c) && isupper(c) ? tolower(c):c;
asc[c]++;
}
int max='a';
for (int i='b'; i<='z'; i++)
if (asc[i]>asc[max])
max=i;
printf("%c %d",max,asc[max]);
}