http://acm.timus.ru/problem.aspx?space=1&num=1723
1 #include <cstdio> 2 #include <cstring> 3 #include <iostream> 4 #include <algorithm> 5 using namespace std; 6 7 int main() 8 { 9 char s1[1000]; 10 cin>>s1; 11 int k=strlen(s1); 12 int b[1000]; 13 memset(b,0,sizeof(b)); 14 for(int i=0; i<k; i++) 15 { 16 b[s1[i]-'a']++; 17 } 18 int c; 19 int max1=0; 20 for(int i=0; i<26; i++) 21 { 22 if(b[i]>max1) 23 { 24 max1=b[i]; 25 c=i; 26 } 27 } 28 printf("%c\n",(c+'a')); 29 return 0; 30 }