标签:style blog http io ar color os sp for
3 abcd bbaa jsdhfjkshdfjksahdfjkhsajkf
a a j
#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
int main()
{
int i,j,len,n,max,k;
char s[1100],t;
scanf("%d",&n);
while(n--)
{
scanf("%s",s);
len=strlen(s);
sort(s,s+len);
for(i=0,t=s[0],max=0;i<len;i++)
{
k=0;
for(j=i;j<len;j++)
{
if(s[i]==s[j])
{
k++;
}
}
if(max<k)
{
max=k;
t=s[i];
}
}
printf("%c\n",t);
}
return 0;
}标签:style blog http io ar color os sp for
原文地址:http://blog.csdn.net/hdd871532887/article/details/41391141