题解 | #字符串排序#
字符串排序
https://www.nowcoder.com/practice/5af18ba2eb45443aa91a11e848aa6723
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int num;
cin>>num;
vector<string> strs;
//cin.sync();//这句
string tmp;
while(num>=0&&getline(cin,tmp)) {
if(tmp=="") continue;
strs.push_back(tmp);
num--;
}
sort(strs.begin(),strs.end());
for(auto i : strs){
cout<<i<<endl;
}
}
// 64 位输出请用 printf("%lld")
记录一下

