1042 字符统计
来源:互联网 发布:饥荒数据修改易宁 编辑:程序博客网 时间:2024/06/08 14:27
#include<stdio.h>int main(){ char str[1001]; gets(str); int table[150], max=0; for(int i=0; i<150; ++i) table[i]=0; for(int i=0; str[i]!='\0'; ++i){ if(str[i]>='A' && str[i]<='Z'){ ++table[str[i]+32]; if(table[str[i]+32] > max) max = table[str[i]+32]; }else if(str[i]>='a' && str[i]<='z'){ ++table[str[i]]; if(table[str[i]] > max) max = table[str[i]]; } } for(int i=97; i<150; ++i){ if(table[i] == max){ printf("%c %d", i, max); break; } } return 0;}
0 0
- 1042_字符统计
- 1042 字符统计
- 1042 字符统计
- 1042 字符统计
- 1042 字符统计
- PAT 1042字符统计
- 【PAT】1042 字符统计
- PAT_乙级 1042 字符统计
- PAT乙级1042 字符统计
- PAT乙级1042 字符统计
- 字符统计
- 统计字符
- 统计字符
- 统计字符
- 统计字符
- 字符统计
- 字符统计
- 字符统计
- OC-scanf、const...
- 乱七八糟的学习笔记(一)
- #1195 : 高斯消元·一(模板题)
- 1041 考试座位号
- 枚举+状态压缩——2013 杭州区域赛A ( UVA 6454 )
- 1042 字符统计
- 进程的状态
- C++输出倒三角加数字
- 子线程更新UI的几种方法
- 如何阅读论文
- bzoj 1010: [HNOI2008] 玩具装箱 toy [斜率优化dp] [动态规划]
- poj1584 A Round Peg in a Ground Hole
- 项目08-25
- 【hadoop】跟着网络上各种攻略来进行CentOS7安装今天中午20160826出的Hadoop2.7.3以及各种爬坑经验