题目:https://www.patest.cn/contests/pat-a-practise/1038
#include<string>
#include<algorithm>
#include<iostream>
using namespace std;
string str[10010];
string out;
int N;
bool cmp(string a, string b)
{
return a+b<b+a;
}
int main()
{
cin>>N;
for(int i=0; i<N; i++)
cin>>str[i];
sort(str, str+N,cmp);
for(int i=0; i<N; i++)
out += str[i];
while (out[0] == '0')
{
out.erase(out.begin());
}
if(out.size() == 0)
cout<<0;
else
cout<<out;
return 0;
}