题解 1870: 统计字符数

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

统计字符数 (C语言代码)

摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<string.h>int main(){ char a[99],b,j,g; int sum=0,i,n,l,k=-1……

自己想出另一个方法

摘要:解题思路:注意事项:参考代码:#include <iostream>#include <cstring>#include <algorithm>using namespace std;struct n……

可AC (C语言代码)

摘要:解题思路:      定义大小为26的整型数组,对应26个英文字母, 判断字符串的每个元素, 对应下表的数组值加加,                     然后进行比较大小,输出即可. 别忘记清空数……

统计字符数 (C++代码)

摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<math.h>#include<iostream>using namespace std;void cmax(char……

统计字符数 (C++代码)

摘要:解题思路:注意事项:参考代码:#include<iostream>#include<algorithm>using namespace std;int main(){ int n,m; cin>>n;……

统计字符数 (C语言代码)AC

摘要:解题思路:注意事项:                            注意数组fg、max_len和t每次置零操作;(不懂可以去掉试试)参考代码:#include <cstdio> #incl…

通用解法

摘要:解题思路:一看就是常规题,按出现次数统计 类似于统计众数,如: 数组 a[ ] = {1 ,2, 2, 2, 3, 3, 4, 5} ,做运算b[a[i] ]++,则b[a[i] ]  <==>b[1……