/*
Name: NYOJ--241--字母统计
Author: shen_渊
Date: 18/04/17 17:12
Description: 水过,C++11特性不能用,尴尬
*/
#include<bits/stdc++.h>
using namespace std;
int main(){
// freopen("in.txt","r",stdin) ;
int t;cin>>t;
while(t--) {
int ct1[27];
int ct[27];
memset(ct,0,sizeof(ct));
string str;
cin>>str;
for(int i=0;i<str.size(); ++i)ct[str[i]-97]++;
copy(ct,ct+27,ct1);
sort(ct,ct+27);
int temp = ct[26];
for(int i=0; i<26; ++i){
if(ct1[i] == temp){
cout<<char(i+97)<<endl;
break;
}
}
}
return 0;
}
NYOJ--241--字母统计
最新推荐文章于 2017-04-20 10:56:03 发布