排序+可能有重复————multiset

#include <iostream>
#include <string>
#include <set>

int main(int argc, char* argv[]){
    int n;
    std::cin >> n;
    std::multiset<std::string> dic;
    std::string str;
    while(std::cin >> str){
        dic.insert(str);
    }
    for(std::string s : dic){
        std::cout << s << std::endl;
    }
    return 0;
}