文章
38
粉丝
11
获赞
2
访问
31.0k
#include<bits/stdc++.h>
using namespace std;
int main(){
string s;
while (getline(cin,s)){
map<char,int> m;
int len = s.size();
char c = 0;
for(int i = 0;i < 26;i++){
c = 'A' + i;
m[c] = 0;
}
for(int i = 0;i < len;i++){
if(s[i] >= 'A' && s[i] <= 'Z')
m[s[i]]++;
}
for(map<char,int> :: iterator t = m.begin();t != m.end();t++){
cout << t->first << ":" << t->second <<endl;
...
登录后发布评论
暂无评论,来抢沙发