/********************************************************************************
今天天气挺冷的~切水题热热手~
********************************************************************************/
#include <iostream>
#include <algorithm>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <bitset>
#include <cctype>
#include <cstdio>
#include <memory>
#include <string>
#include <vector>
#include <cmath>
#include <ctime>
#include <queue>
#include <stack>
#include <list>
#include <map>
#include <set>
using namespace std;
#define lowbit(x) ( (x) & ( (x) ^ (x - 1) ) )
//typedef long long LL;
//typedef unsigned long long ULL;
typedef __int64 LL;
typedef unsigned __int64 ULL;
typedef pair<int, int> PII;
typedef pair<double, double> PDD;
typedef map<int, int>::iterator MI;
typedef vector<int>::iterator VI;
typedef list<LL>::iterator LI;
typedef set<int>::iterator SI;
const int INF_INT = 0x3f3f3f3f;
const LL INF_LL = 0x7fffffffffffffff;
const double oo = 10e9;
const double eps = 10e-7;
const double PI = acos(-1.0);
const int MAXN = 104;
bool cmp(const string &sa, const string &sb)
{
return sa + sb < sb + sa;
}
void ace()
{
int n;
string str[MAXN];
cin >> n;
for (int i = 0; i < n; ++i)
{
cin >> str[i];
}
sort(str, str + n, cmp);
for (int i = 0; i < n; ++i)
{
cout << str[i];
}
cout << endl;
return ;
}
int main()
{
ace();
//system("pause");
return 0;
}
SGU 347 字符串
最新推荐文章于 2020-12-05 09:21:38 发布