题目链接:http://bailian.openjudge.cn/practice/2742
# include <stdio.h>
# include <string.h>
int main()
{
int n;
int i;
char str[1001];
int c[26];
int p=0;
scanf("%d",&n);
while(n--)
{
for(i=0;i<26;i++)
c[i]=0;
scanf("%s",str);
for(i=0;str[i]!='\0';i++)
c[str[i]-'a']++;
for(i=0;i<26;i++)
{
if(c[i]>c[p])
p=i;
}
printf("%c %d\n",p+'a',c[p]);
}
return 0;
}