28 lines
364 B
C++
28 lines
364 B
C++
#include <iostream>
|
|
#include <set>
|
|
#include <string>
|
|
using namespace std;
|
|
|
|
struct cmp{
|
|
bool operator()(const string& a, const string& b){
|
|
return a + b > b + a;
|
|
}
|
|
};
|
|
|
|
int main(){
|
|
set<string, cmp> a;
|
|
int n;
|
|
cin >> n;
|
|
string tmp;
|
|
for(int i = 0;i < n; i++){
|
|
cin >> tmp;
|
|
a.emplace(tmp);
|
|
}
|
|
for(string x : a){
|
|
cout << x ;
|
|
}
|
|
cout << endl;
|
|
return 0;
|
|
}
|
|
|