#include <iostream> #include <string.h> #include <cstring> #include <vector> using namespace std; int cmp(string a,string b){ return a.length() < b.length(); } int main() { int n; while( cin>>n){ getchar(); vector<string> s; while(n--){ string t; getline(cin,t); if(t=="stop") break; s.push_back(t); } sort(s.begin(),s.end(),cmp); for(vector<string>::iterator it = s.begin();it!=s.end();it++) cout<<*it<<endl; } return 0; }
0.0分
0 人评分
IP判断 (C++代码)浏览:677 |
点我有惊喜!你懂得!浏览:1515 |
大神老白 (C语言代码)浏览:715 |
C语言程序设计教程(第三版)课后习题6.3 (C语言代码)浏览:511 |
简单的a+b (C语言代码)浏览:529 |
P1001 (C语言代码)浏览:801 |
【偶数求和】 (C语言代码)浏览:557 |
WU-陶陶摘苹果2 (C++代码)浏览:973 |
C语言训练-数字母 (C语言代码)浏览:608 |
Tom数 (C语言代码)浏览:495 |