文章
79
粉丝
0
获赞
502
访问
19.6k
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
bool cmp(string a, string b) {
return a.size() < b.size();
}
int main() {
int n;
while (cin >> n) {
vector<string> v;
for (int i = 0; i <= n; i ++ ) {
string s;
getline(cin, s);
if (s == "stop") break;
if (s != "") v.push_back(s);
}
sort(v.begin(), v.end(), cmp);
for (auto x : v)
cout << x << endl;
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发