ural 1723 Sandro's Book
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 ;
}
ural 1723 Sandro's Book的更多相关文章
- 后缀数组 POJ 3974 Palindrome && URAL 1297 Palindrome
题目链接 题意:求给定的字符串的最长回文子串 分析:做法是构造一个新的字符串是原字符串+反转后的原字符串(这样方便求两边回文的后缀的最长前缀),即newS = S + '$' + revS,枚举回文串 ...
- ural 2071. Juice Cocktails
2071. Juice Cocktails Time limit: 1.0 secondMemory limit: 64 MB Once n Denchiks come to the bar and ...
- ural 2073. Log Files
2073. Log Files Time limit: 1.0 secondMemory limit: 64 MB Nikolay has decided to become the best pro ...
- ural 2070. Interesting Numbers
2070. Interesting Numbers Time limit: 2.0 secondMemory limit: 64 MB Nikolay and Asya investigate int ...
- ural 2069. Hard Rock
2069. Hard Rock Time limit: 1.0 secondMemory limit: 64 MB Ilya is a frontman of the most famous rock ...
- ural 2068. Game of Nuts
2068. Game of Nuts Time limit: 1.0 secondMemory limit: 64 MB The war for Westeros is still in proces ...
- ural 2067. Friends and Berries
2067. Friends and Berries Time limit: 2.0 secondMemory limit: 64 MB There is a group of n children. ...
- ural 2066. Simple Expression
2066. Simple Expression Time limit: 1.0 secondMemory limit: 64 MB You probably know that Alex is a v ...
- ural 2065. Different Sums
2065. Different Sums Time limit: 1.0 secondMemory limit: 64 MB Alex is a very serious mathematician ...
随机推荐
- puppet report import
把Puppet报告导入Puppet Dashboard 现在Dashboard正在运行,而我们需要确保它能够获取Puppet报告.完成这项工作有几种方法,开始的时候都是用Rake任务导入旧报告.在/u ...
- F - Count the Colors - zoj 1610(区间覆盖)
有一块很长的画布,现在想在这块画布上画一些颜色,不过后面画的颜色会把前面画的颜色覆盖掉,现在想知道画完后这块画布的颜色分布,比如 1号颜色有几块,2号颜色有几块.... *************** ...
- linux关于readlink函数获取运行路径的小程序
http://blog.csdn.net/djzhao/article/details/8178375 相关函数: stat, lstat, symlink表头文件: #include <u ...
- android学习之4种点击事件的响应方式
如题,下面就一一列出对点击事件响应的4种方式: 第一种:内部类的形式: package com.example.dail; import android.net.Uri; import android ...
- ButterKnife的使用
ButterKnife是一个Android View注入的库. 1.开始使用 1.1 配置Eclipse 在使用ButterKnife需要先配置一下Eclipse. 项目右键-Properties-J ...
- Java线程的相关方法
~ start() 启动线程方法 ~ run() 调用start()方法时,真正执行的就是该方法的方法体 ~ sleep() 让当前线程睡眠,睡眠到期自动苏醒,并进入可运行状态,而不是运行状态 ...
- android实现边框圆角
1. 在drawable 下新建 shape.xml 文件 Xml代码 : 1 <?xml version="1.0" encoding="UTF-8" ...
- web页面缓存技术之Local Storage
业务:检测页面文本框的值是否有改变,有的话存入缓存,并存储到数据库,这样用户异常操作后再用浏览器打开网页,就可避免重新填写数据 数据库表:Test,包含字段:PageName,PageValue BL ...
- TCP总结
TCP协议 <计算机网络>谢希仁 及笔记 TCP 的那些事儿(上):http://coolshell.cn/articles/11564.html TCP 的那些事儿(下):htt ...
- AngularJs学习html转义
MainApp.directive('ngHtml', function () { function watch(scope, el, watchExp){ scope.$watch(watchExp ...