孩子们的游戏【字符串连接】

#include <bits/stdc++.h>
using namespace std;
int n;
const int maxn=100;
string s[100];
bool cmp(string a,string b)
{
	return a+b>b+a;
}
int main()
{
	while(cin>>n&&n)
	{
	for(int i=1;i<=n;i++) cin>>s[i];
	sort(s+1,s+1+n,cmp);
	for(int i=1;i<=n;i++) cout<<s[i];
	cout<<endl; 
	}	
	return 0;
 } 
全部评论

相关推荐

水墨不写bug:疑似没有上过大学
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务