淦啊,好久不写memset都忘记怎么写了,调了半天QAQ
#include<stdio.h>
#include<string.h>
char a[1005];
int alp[30];
int time[1005];
/*
abcdd
ababab
*/
int main()
{while(scanf("%s",a)==1){int temp=1;int n=strlen(a);for(int i=0;i<n;i++) alp[a[i]-'a'+1]++; for(int i=1;i<=29;i++) time[alp[i]]++;for(int i=2;i<1001;i++){if(time[i]>time[temp]) temp=i;}printf("%d",temp);for(int i=0;i<29;i++) if(alp[i]==temp) printf(" %c",i+'a'-1);printf("\n");memset(time,0,sizeof(time));memset(alp,0,sizeof(alp));}return 0;
}