map底层采用红黑树使用 for (auto it = alpha.begin(); it != alpha.end(); advance(it, 1)) 可以从小到大按照字典序排序 #include <bits/stdc++.h> using namespace std; string to_lower(string s) { for (char& ch : s)ch = tolower(ch); return s; } int main() { map<string, int> alpha; string s; whi...