Children's Game
Children's Game
代码
#include<iostream>
#include<algorithm>
#include<stdio.h>
using namespace std;
string ao[51];
bool com(string a,string b)
{
return a + b > b + a;
}
int main()
{
int n;
while(cin>>n)
{
if (n == 0)break;
for (int i = 0; i < n; i++)
cin >> ao[i];
sort(ao, ao + n, com);
for (int i = 0; i < n; i++)
cout << ao[i];
cout << endl;
}
return 0;
}