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;
}
posted @ 2022-02-13 21:40  Lewis_1231  阅读(37)  评论(0)    收藏  举报