您的位置:首页 > 其它

ural 1723 Sandro's Book

2014-03-19 19:47 239 查看
http://acm.timus.ru/problem.aspx?space=1&num=1723

#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
char s1[1000];
cin>>s1;
int k=strlen(s1);
int b[1000];
memset(b,0,sizeof(b));
for(int i=0; i<k; i++)
{
b[s1[i]-'a']++;
}
int c;
int max1=0;
for(int i=0; i<26; i++)
{
if(b[i]>max1)
{
max1=b[i];
c=i;
}
}
printf("%c\n",(c+'a'));
return 0;
}


View Code
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: