代码实现
#include <bits/stdc++.h> using namespace std; int main() { map<char, int> mp; string s; cin >> s; for (auto c : s) mp[c]++; for (auto c : mp) printf("%c:%d\n", c.first, c.second); return 0; }