题解 | #字符统计#
字符统计
https://www.nowcoder.com/practice/c1f9561de1e240099bdb904765da9ad0
#include <iostream>
#include <map>
using namespace std;
int main() {
string s;
string s0;
cin >> s;
map<char,int> l;
map<int,string> q;
for(auto e : s){
l[e]++;
}
for(auto e : l){
q[e.second].push_back(e.first);
}
for(auto e : q){
s0 = e.second + s0;
}
cout << s0 << endl;
}
// 64 位输出请用 printf("%lld")
查看17道真题和解析
