您的位置:首页 > 其它

成长轨迹44 【ACM算法之路 百炼poj.grids.cn】【字符串处理】【2799、2976、2975、2742】

2012-02-12 11:19 232 查看
一次ac的就不说啥了。。

2799:浮点数格式

View Code

#include <cstdio>
#include <string.h>
int main()
{
int t;
int n[26];
scanf("%d",&t);
for(int i=0;i<t;i++)
{
memset(n,0,sizeof(n));
char s[1010];
scanf("%s",s);
int len = strlen(s);
for(int j=0;j<len;j++)
{
n[s[j]-'a']++;
}
int max=0;
for(int j=1;j<26;j++)
{
if(n[max]<n[j])
max=j;
}
printf("%c %d\n",'a'+max,n[max]);

}
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐