PAT1021

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;
}
posted @ 2020-11-06 22:27  晓尘  阅读(79)  评论(0)    收藏  举报