#include "stdio.h"
#include "string"
#include "algorithm"
#include<iostream>
using namespace std;
int cmp(string a,string b)
{
return a+b>b+a;
}
int main()
{
int n,i;
string str[55];
while(~scanf("%d",&n))
{
if(n==0) break;
for(i=0;i<n;i++) cin>>str[i];
sort(str,str+n,cmp);
for(i=0;i<n;i++) cout<<str[i];
printf("\n");
}
return 0;
}
uva 10905 Children's Game
最新推荐文章于 2017-01-07 18:49:17 发布