ural 1723 Sandro's Book
2014-03-19 19:47
239 查看
http://acm.timus.ru/problem.aspx?space=1&num=1723
View Code
#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
相关文章推荐
- 字符串专项:Ural 1723
- URAL 1723. Sandro's Book(数学啊)
- URAL 1723 Sandro's Book
- Ural 1723. Sandro's Book
- URAL 1723. Sandro's Book
- Ural 1223.Chernobyl’ Eagle on a Roof
- URAL 1297 最长回文子串(后缀数组)
- Ural 1209
- URAL 1297 Palindrome(后缀数组)
- URAL 1990 Podracing(尺取法)
- Ural 1303 Minimal Coverage
- URAL 1114 Boxes(简单dp)
- 【Ural1028】Stars-线段树和树状数组入门题
- URAL 2029 Towers of Hanoi Strike Back 汉诺塔,从初始状态到任意给出状态需要的次数
- URAL 1333
- URAL 1297 Palindrome
- Petrozavodsk Winter-2013. Ural FU Contest
- ural 2071 - Juice Cocktails
- ural1297 求最长回文子串(后缀数组/Manacher算法)
- URAL 1079 Maximum 递推