主站
DreamJudge
院校信息
专业题库
模拟考试
机试真题
专业课程
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
我能走到对岸吗
2024年4月28日 00:11
字母统计 题解:
P1292
回复 0
|
赞 1
|
浏览 85
#include <bits/stdc++.h> using namespace std; string str; int cnt[27]; int main() { while(cin >> str) { memset(cnt, 0, sizeof cnt); for(int i = 0; i < str.size(); i ++) if(str[i] >= 'A' && str[i] <= 'Z') cnt[str[i] - 'A'] ++; for(...
1576684866
2024年3月21日 16:17
字母统计 题解:
P1292
回复 0
|
赞 0
|
浏览 266
#include <cstdio> using namespace std; #include <string.h> #include <iostream> #include <map> #include <stdlib.h> int main() { map<char, int>M; for (int i = 0; i < 26; i++) { &nbs...
wei886521
2024年3月20日 01:46
字母统计 题解:
P1292
回复 0
|
赞 0
|
浏览 198
#include<iostream> using namespace std; int main(){ char A[1000]; cin >> A; int len = strlen(A); int B[26];//顺序统计每一个大写字母个数 char C[1000]; for (int i = 0; i < 26;...
小酒
2024年3月16日 17:55
字母统计 题解:
P1292
回复 0
|
赞 0
|
浏览 189
1292解题思路:利用了数组的来记录,而不是存储 #include <bits/stdc++.h> using namespace std; int main() { char a[105]={0}; int b[105]={0}; //A为65 gets(a); int l=strlen(a); int k=0; for(int j=0;j<l;j++) { k=a[j]%65; b[k]++; } for(int i=0;i<26;i++) { printf("%c:%d\n",6...
easymoney
2024年3月13日 12:16
字母统计 题解:
P1292
回复 0
|
赞 0
|
浏览 237
#include <stdio.h> #include <string.h> int main() { int count[26] = { 0 }; static char c[100]; gets(c); for (int i = 0;c[i] != '\0';i++) { if (c[i] >= ...
红毛舒肤佳
2024年3月9日 21:14
字母统计 题解:
P1292
回复 0
|
赞 0
|
浏览 271
#include <bits/stdc++.h> using namespace std; int main(){ string str; cin>>str; int a[26]={0}; for(int i=0;i<str.length();i++){ if(str[i]>='A'&&str[i]<='Z') &nb...
huanghu
2024年3月7日 18:49
字母统计 题解:c++ 利用map来实现统计
P1292
回复 0
|
赞 0
|
浏览 249
#include<stdio.h> #include<string> #include<iostream> #include<map> using namespace std; int main(){ string str; cin>>str; map<char,int> Mymap; int len = str.length(); for(int i = 0; i<26; i++){ ...
williams
2024年3月6日 11:50
字母统计 题解:
P1292
回复 0
|
赞 0
|
浏览 236
#include <stdio.h> #include <stdbool.h> #include <math.h> #include <string.h> int main(void) { char s[1000]; char s1[]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N', 'O','P','Q','R','S','T','U','V','W','X','Y','Z'}; while(gets(s)!...
orderrr
2024年2月24日 17:20
字母统计 题解: 用整型数组去记录字母出现的次数
P1292
回复 0
|
赞 0
|
浏览 282
#include <bits/stdc++.h> using namespace std; /* 思想: 1、采用for循环 遍历 各个 那啥的次数 2、采用整型数组的形式 去记录字母的出现次数 */ int main() { int num[27] = {0}; string s; while (cin >> s) { for (int i = 0; i < s.size...
halo_777
2024年2月18日 20:05
字母统计 题解:
P1292
回复 0
|
赞 1
|
浏览 250
```c++ #include<bits/stdc++.h> using namespace std; int tmp[100]; int main() { char s[105]; while(cin >> s) { int len = strlen(s); for (int i = 0; i < len...
1
2
3
题目
字母统计
题解数量
23
发布题解
热门题解
1
字母统计(交大机试)
2
字母统计 题解:
3
各个大写字母数量统计
4
遍历统计
5
字母统计 题解:
6
数组计数(笨办法)
7
数组统计
8
过
9
字母统计 题解:c++ 利用map来实现统计
10
字母统计 题解: