题目大意:给出N个数字串,要求拼出有数字最大的串

解题思路:用string就很好解决

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
using namespace std;
const int maxn = 60;
string str[maxn];

int cmp(string a, string b) {
	return a+b > b+a;
}
 
int main() {
	int n;
	while(scanf("%d", &n) && n) {
		for(int i = 1; i <= n ;i++)
			cin >> str[i];
		sort(str+1,str+n+1,cmp);
		for(int i = 1; i <= n; i++)
			cout << str[i];	
		cout << endl;	
	}
	return 0;
}