题解 | #字符串排序#
字符串排序
https://www.nowcoder.com/practice/5af18ba2eb45443aa91a11e848aa6723
直接sort排序
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int num;
cin >> num;
string s;
vector<string> v;
while(cin >> s){
v.push_back(s);
}
sort(v.begin(), v.end());
for(string s2 : v){
cout << s2 << endl;
}
}
