ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#167301 | #984. 统计字符 | jzx1234 | 100 | 0ms | 1228kb | C++ | 263b | 2023-01-07 11:47:58 | 2023-01-07 11:47:59 |
answer
#include<bits/stdc++.h>
#include<string>
#include<iomanip>
using namespace std;
int b[26];
int main(){
string a;
cin>>a;
for(int i=0;a[i]!='#';i++){
b[a[i]-'a']++;
}
for(int i=0;i<26;i++){
if(b[i]!=0)cout<<char(i+'a')<<':'<<b[i]<<'\n';
}
}
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 33
Accepted
time: 0ms
memory: 1224kb
input:
aacdhjrsss#
output:
a:2 c:1 d:1 h:1 j:1 r:1 s:3
result:
ok 7 lines
Test #2:
score: 33
Accepted
time: 0ms
memory: 1228kb
input:
dljfgkldfjgldfglfgjdfjgfdjgdfjglfgj#
output:
d:6 f:8 g:8 j:7 k:1 l:5
result:
ok 6 lines
Test #3:
score: 33
Accepted
time: 0ms
memory: 1228kb
input:
woeurihixhnvirnvoeibovbivebveoivhievbvniocvniweyrvqirviviivievqooq#
output:
b:4 c:1 e:7 h:3 i:14 n:4 o:7 q:3 r:4 u:1 v:14 w:2 x:1 y:1
result:
ok 14 lines