首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
ccccccyes
2024年8月28日 09:50
字母频率 题解:
P1019
回复 0
|
赞 9
|
浏览 2.3k
#include <iostream> using namespace std; int arr[30] = {0}; int main(){ string str; int index; //cin>>str在读到空格时就结束了 getline(cin,str); for(int i = 0; i<=str.size()-1; i++){ if(str[i]>='A'&&str[i]<='Z'){ index = str[i] - 'A'; arr...
Candour
2024年4月20日 16:09
字母频率 (C++11 哈希表)题解:
P1019
回复 0
|
赞 7
|
浏览 1.2k
#include<bits/stdc++.h> using namespace std; unordered_map<char, int> res; int main() { string str; getline(cin, str); for(int i = 0; i < str.size(); i ++) { if(str[i] >= 'A' && str[i] <= 'Z' ) res[str[i] + 32] ++; ...
RingoCrystal
2024年4月3日 15:12
字母频率 题解:想问一下有没有大佬知道,为什么加了while就只能过6
P1019
回复 2
|
赞 2
|
浏览 1.3k
#include <bits/stdc++.h> using namespace std; int main(){ string s; while(getline(cin,s)){ for(int i=0;i<s.size();i++){ if(s[i]>='A'&&s[i]<='Z')s[i]=s[i]-'A'+'a'; } map<char,int> sheet; for(int i=0;i<s.size();i++){ if(s[i]>='a'&...
20082123
2024年3月28日 17:56
字母频率 题解:
P1019
回复 0
|
赞 3
|
浏览 2.0k
#include<bits/stdc++.h> using namespace std; int main(){ string s; int k,max=0; int a[26]={0}; getline(cin,s); for(int i=0;i<s.size();i++){ if('...
williams
2024年3月24日 09:58
字母频率 题解:C
P1019
回复 0
|
赞 4
|
浏览 1.5k
#include <stdio.h> #include <string.h> #include <ctype.h> int main(){ char s[1000],count[30]; for(int i=0;i<30;i++){ count[i]=0; } gets(s); for(int i=0;i<strlen(s);i++){ s[i] = tolower(s[i]); count[(s[i]-97)]++; } int max,d; max = count[0]; ...
1576684866
2024年3月21日 20:51
字母频率 题解:
P1019
回复 0
|
赞 0
|
浏览 1.0k
#define _CRT_SECURE_NO_WARNINGS #include <cstdio> using namespace std; #include <string.h> #include <algorithm> #include <iostream> #include <map> #include <stdlib.h> int main() { char s[1005]; gets(s); &nb...
小酒
2024年3月16日 18:41
字母频率 题解:
P1019
回复 0
|
赞 3
|
浏览 1.2k
1019解题思路:同样,用数组来记录 #include <bits/stdc++.h> using namespace std; int main() { char a[1000]={0}; gets(a); int l=strlen(a); int b[105]={0}; for(int i=0;i<l;i++) { if(a[i]>='A'&&a[i]<='Z') { int k=0; k=a[i]%65; b[k]++; } if(a[i]>=...
FIVEszc
2024年3月13日 20:51
字母频率 题解:C++
P1019
回复 0
|
赞 1
|
浏览 1.6k
#include <bits/stdc++.h> using namespace std; typedef struct table{ char a; int count; }; char s[1000]; int main() { table alphabet [26]; for(int i=0;i<26;i++) { al...
Cookie‘s AE86
2024年3月13日 10:47
字母频率 题解:c++ vector、set、count实现
P1019
回复 0
|
赞 0
|
浏览 1.1k
#include<bits/stdc++.h> using namespace std; int main(){ string s; getline(cin, s); vector<char> vs; set<char>ss; //将字符串转换成小写 transform(s.begin(), s.end(), s.begin(), ::tolower); //分别将字符串存入动态数组和集合中 for(int i = 0; i < s.size(); i++...
xhpn
2024年3月5日 21:23
字母频率 题解:数组模拟哈希表
P1019
回复 0
|
赞 0
|
浏览 1.1k
#include<stdio.h> #include<string.h> int main(){ int count[26]={0}; int i; char s[1000]; gets(s); int len=strlen(s); for(i=0;i<len;i++){ ...
1
2
3
4
题目
字母频率
题解数量
32
发布题解
在线答疑
热门题解
1
字母频率 题解:纯数组 C语言写法 很好理解
2
字母频率 题解:
3
字母频率 (C++11 哈希表)题解:
4
字母频率 题解:自用
5
使用哈希,感觉应该最简单了
6
字母频率 题解:cpp 哈希表 所有字符统计频率
7
字母频率 题解:C
8
字母频率 题解:
9
字母频率 题解:
10
题解:字母频率