首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
AORIE
2026年3月26日 10:03
字母频率 题解:
P1019
回复 0
|
赞 0
|
浏览 34
#include <stdio.h> #include <string.h> char a[10005]; int cnt[27]; int main(){ gets(a);// %s 会被空格中断,用gets 或者fget int len=strlen(a); for(int i = 0;i<len;i++){ if(a[i]>='a'&&a[i]<='z'){ cnt[a[i]-'a']++; }else if(a[i]>='A'&&a[i]<='Z'){...
HKX9XAS
2026年3月20日 16:21
字母频率 题解:如果用while( getline(cin,s) ),
P1019
回复 0
|
赞 2
|
浏览 94
#include<stdio.h> #include<iostream> #include<string> using namespace std; int main(){ string s; int counter[26]={0}; //统计26个字母出现次数 getline(cin,s); for(int i=0; i<26; i++) counter[...
yauqq
2026年3月18日 15:16
字母频率 题解:
P1019
回复 0
|
赞 3
|
浏览 89
#include<bits/stdc++.h> using namespace std; int main(){ map<char,int> mp; string str; getline(cin, str); int maxc = 0; char maxch; for(auto it:str){ if(isalpha(it)){ char c = tolower(it); mp[c]++; if(maxc < mp[c]){ maxc = mp[c]; maxch = ...
太一
2026年3月13日 22:09
字母频率 题解:简便代码
P1019
回复 0
|
赞 3
|
浏览 132
#include<iostream> #include<cmath> #include<algorithm> #include<string> using namespace std; int main() { string s; getline(cin, s); int arr[26] = { 0 }, Max = 0, index = 0; for (int i = ...
ZeroQi_404
2026年3月11日 14:00
字母频率 题解:
P1019
回复 0
|
赞 1
|
浏览 76
#include <iostream> #include <string> #include <cctype> using namespace std; int main(){ string s; getline(cin, s); int cnt[26] = {0}; for(char c : s){ if(isalpha(c)){ c = tolower(c); cnt[c - 'a']++; } ...
白米饭607
2026年3月5日 18:16
字母频率 题解:
P1019
回复 0
|
赞 3
|
浏览 191
#include <stdio.h> #include <stdbool.h> bool is_alpha1(char a){ if(a>='a'&&a<='z')return true; return false; } bool is_alpha2(char a){ if(a>='A'&&a<='Z')re...
mlx
2026年1月31日 17:08
字母频率 题解:
P1019
回复 0
|
赞 10
|
浏览 305
#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
|
赞 2
|
浏览 307
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
|
赞 1
|
浏览 304
用数组统计字母的频率 #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
|
浏览 180
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 ...
1
2
3
4
题目
字母频率
题解数量
38
发布题解
在线答疑
热门题解
1
字母频率 题解:纯数组 C语言写法 很好理解
2
字母频率 (C++11 哈希表)题解:
3
字母频率 题解:
4
字母频率 题解:
5
字母频率 题解:自用
6
字母频率 题解:非常棒的题解
7
使用哈希,感觉应该最简单了
8
字母频率 题解:cpp 哈希表 所有字符统计频率
9
字母频率 题解:C
10
字母频率 题解:简便代码