tj
2024-10-11 19:22:48
发布于:上海
0阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
int a[26] = {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};
for(int i = 0;i<s.size();i++){
a[s[i]-'a']++;
}
for(int i = 0;i<26;i++){
if(a[i]!=0)
cout<<char(i+'a')<<':'<<a[i]<<endl;
}
}
这里空空如也
有帮助,赞一个