文章

81

粉丝

0

获赞

275

访问

10.6k

头像
字母统计 题解:map
P1292 上海交通大学机试题
发布于2025年3月24日 21:34
阅读数 54

#include<bits/stdc++.h>
using namespace std;
int main(){
	map<char ,int> m;
	string str;
	cin>>str;
	for(char c:str){
		m[c]++;
	}
	for(char i='A';i<='Z';i++){
		cout<<i<<":"<<m[i]<<endl;
	}
}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发