题解 | #字符串排序#
字符串排序
http://www.nowcoder.com/practice/5af18ba2eb45443aa91a11e848aa6723
无脑调用标准库
#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;
}