ural 1723 Sandro's Book

时间:2022-02-08 10:08:32

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[];
cin>>s1;
int k=strlen(s1);
int b[];
memset(b,,sizeof(b));
for(int i=; i<k; i++)
{
b[s1[i]-'a']++;
}
int c;
int max1=;
for(int i=; i<; i++)
{
if(b[i]>max1)
{
max1=b[i];
c=i;
}
}
printf("%c\n",(c+'a'));
return ;
}