首页 > 其他 > 详细

PAT1021

时间:2020-11-06 23:32:11      阅读:36      评论:0      收藏:0      [点我收藏+]

https://pintia.cn/problem-sets/994805260223102976/problems/994805300404535296

#include<iostream>
#include <map>

using namespace std;

const int N = 1010;
char a[N];
map<char,int> m;

int main()
{
    cin.getline(a,1005);
    for(int i = 0; a[i]; i++)
        m[a[i]]++;
    for(auto x : m) cout << x.first << ":" << x.second << endl;
    return 0;
}

PAT1021

原文:https://www.cnblogs.com/ApStar/p/13939306.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!