文章
28
粉丝
226
获赞
53
访问
146.0k
#include <iostream>
using namespace std;
int main()
{
string str;
while(getline(cin, str)){
int num[26] = {0};
for(int i = 0;i < str.size();i++){
if('A' <= str[i] && str[i] <= 'Z'){
int index = str[i] - 'A';
num[index]++;
}
}
for(int i = 0;i < 26;i++){
char zimu = 'A' + i;
cout << zimu << ":" << num[i] << endl;
}
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发