首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
mlx
2026年1月31日 17:08
字母频率 题解:
P1019
回复 0
|
赞 0
|
浏览 28
#include<iostream> using namespace std; const int N=1010; int cnt[26]; char s[N]; int main() { cin.getline(s,N); for(int i=0;s[i]!='\0';i++) { if(s[i]>='a'&&s[i]<='z') cnt[s[i]-'a']++; else if(s[i]>='A'&&s[i]<='Z') cnt[s[i]-'A']+...
奶龙大王
2026年1月27日 15:13
字母频率 题解:
P1019
回复 0
|
赞 0
|
浏览 54
Map+cctype判断字母与大小写转换函数写法 #include <iostream> #include <map> #include <cctype> // for isalpha, tolower #include <string> using namespace std; int main() { string s; getline(cin, s); // 读取整行输入 ma...
曾不会
2026年1月25日 10:50
字母频率 题解:
P1019
回复 0
|
赞 0
|
浏览 77
用数组统计字母的频率 #include<stdio.h> #include<string.h> int main() { char s[1010]; int a[27]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; fgets(s,1010,stdin); int l=strlen(s);  ...
曾不会
2026年1月25日 10:43
字母频率 题解:
P1019
回复 0
|
赞 0
|
浏览 62
python字典 n=input() t=dict() l=len(n) ma=0 mma='a' for i in n: if(i.isupper() or i.islower()): if (i.isupper()): i = i.lower() if i in t: t[i] += 1 else: t[i] = 1 if (ma < t[i]): ma ...
Jun_
2026年1月23日 10:28
字母频率 题解:C++
P1019
回复 0
|
赞 0
|
浏览 67
#include<stdio.h> #include <iostream> #include<math.h> #include <stdlib.h> #include <string> #include<cctype> #include<algorithm> using namespace std; int main () { string str1; int arr...
西电机试专家
2025年3月25日 16:54
字母频率 题解:非常棒的题解
P1019
回复 0
|
赞 2
|
浏览 927
#include<bits/stdc++.h> using namespace std; int main(){ map<char,int> M; string s; getline(cin,s); string str;//只含有小写字母的字符串 for(int i=0;i<s.size();i++){ ...
jaygee_
2025年3月12日 20:33
字母频率 题解:
P1019
回复 0
|
赞 2
|
浏览 1.0k
#include<bits/stdc++.h> using namespace std; int main() { string s; getline(cin, s); map<char, int> map; for(char c : s) { if(isalpha(c)) { char a = tolower(c); map[a] ++; // map记录每个字符出现次数 } } char maxChar = ' '; int maxCount = 0; for(auto c :...
Xsw777
2025年3月3日 16:03
字母频率 题解:纯数组 C语言写法 很好理解
P1019
回复 0
|
赞 11
|
浏览 1.1k
#include <stdio.h> #include <string.h> int main(){ char a[1000] = {0}; gets(a); int i = 0; int len = strlen(a); for(i=0;i<len;i++){ &...
quyang
2025年2月28日 19:20
字母频率 题解:cpp 哈希表 所有字符统计频率
P1019
回复 0
|
赞 4
|
浏览 991
#include<iostream> #include<string> #include<unordered_map> #include<cctype> using namespace std; //从键盘输入一个字符串(可能含有数字、字母、其他可见字符), //输出出现频率最高的英文字母及次数,忽略字母的大小写(如大写A和小写a均视为a) int main(){ string s; getline(cin,s); unordered_map<char,int> mp; //去掉...
固态氧化碳
2025年2月27日 23:17
字母频率 题解:自用
P1019
回复 0
|
赞 6
|
浏览 1.2k
#include<iostream> #include<stdio.h> using namespace std; void func(string &s) { for(int i=0;i<s.length();i++) { if(s[i]>='A'&&s[i]<='Z') { ...
1
2
3
4
题目
字母频率
题解数量
32
发布题解
在线答疑
热门题解
1
字母频率 题解:纯数组 C语言写法 很好理解
2
字母频率 题解:
3
字母频率 (C++11 哈希表)题解:
4
字母频率 题解:自用
5
使用哈希,感觉应该最简单了
6
字母频率 题解:cpp 哈希表 所有字符统计频率
7
字母频率 题解:C
8
字母频率 题解:
9
字母频率 题解:
10
题解:字母频率