Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define lli long long int
- #define ulli unsigned long long int
- #define Pi 3.14159265358979323846264338327950288419716939937510
- vector <string> X;
- bool comp(string a , string b){
- return a.length() > b.length();
- }
- int main(){
- ios :: sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
- while(1){
- int n;
- cin>>n;
- X.resize(n);
- for(auto &i : X){
- cin>>i;
- }
- sort(X.begin(),X.end(),comp);
- int x = X.size();
- cout<<endl;
- for(auto &i : X){
- cout<<i<<" ";
- }
- cout<<endl;
- }
- }
Add Comment
Please, Sign In to add comment