题解 | #字符串排序#
字符串排序
https://www.nowcoder.com/practice/5af18ba2eb45443aa91a11e848aa6723
排序+可能有重复————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;
}