uva 10905 Children's Game
#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;
}版权声明:本文为博主原创文章,未经博主允许不得转载。http://xiang578.top/

浙公网安备 33010602011771号