#include <cstdio>
#include <string>
#include <algorithm>
#include <iostream>
using namespace std;
int n;
string a[55];
bool cmp(string x,string y)
{
return x+y > y+x;
}
int main()
{
//ios::sync_with_stdio(false);
while(scanf("%d",&n)!=EOF && n)
{
for(int i=1;i<=n;i++) cin>>a[i];
sort(a+1,a+n+1,cmp);
for(int i=1;i<=n;i++) cout<<a[i];
printf("\n");
}
return 0;
}
转载于:https://www.cnblogs.com/ouqingliang/p/9245295.html