Run ID:28042
提交时间:2022-06-12 19:12:07
#include<iostream> #include<algorithm> using namespace std; string s[25]; bool cmp(string p,string q){ return p+q>q+p; } int main(){ int n; while(scanf("%d",&n)!=EOF){ for(int i=0;i<n;i++) cin>>s[i]; sort(s,s+n,cmp); for(int i=0;i<n;i++){ cout<<s[i]; } } return 0; }