无脑调用标准库
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
int main(int argc, char const *argv[])
{
int n;
std::vector<std::string> snum;
std::string stmp;
std::cin >> n;
while (std::cin >> stmp)
{
snum.push_back(stmp);
}
std::sort(snum.begin(), snum.end());
for (auto s : snum)
{
std::cout << s << std::endl;
}
return 0;
}