题解 | #字符串排序#
字符串排序
https://www.nowcoder.com/practice/5af18ba2eb45443aa91a11e848aa6723
//https://www.nowcoder.com/practice/5af18ba2eb45443aa91a11e848aa6723?tpId=37&tqId=21237&rp=1&ru=/exam/oj/ta&qru=/exam/oj/ta&sourceUrl=%2Fexam%2Foj%2Fta%3FtpId%3D37&difficulty=undefined&judgeStatus=undefined&tags=&title= #include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int n = 0; vector<string> slist; while (cin >> n) { slist.resize(n); for(int i = 0;i<n;i++) cin >> slist[i]; sort(slist.begin(), slist.end()); for(auto c:slist) cout << c << endl; } }