##利用map,set树的自动排序,效率略有提高 #include <iostream> #include <map> #include <set> using namespace std; int main() { char a; map<char,int > st; map<int,set<char> > st2; while (cin >> a ) { ++st[a]; } for(auto ite = st.begin();ite ...