#include <iostream> #include <set> using namespace std; int main(){ // 给定一个正整数n int n; cin>>n; // 用一个字符串数组进行排序 multiset<string> res; string str; for(int i = 0; i < n; ++i){ cin>>str; res.emplace(str); } // 输出排好序之后的元素 for(auto &ele: res){ cout<<ele<<endl; } return 0; }