标签:解析 game out amp putc class mes 代码 its
微扰法贪心经典题
#include <bits/stdc++.h>
using namespace std;
bool cmp(const string &x, const string &y) {
return x + y > y + x;
}
int main() {
int n;
while (~scanf("%d", &n) && n) {
string str[55];
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];
putchar(10);
}
}
标签:解析 game out amp putc class mes 代码 its
原文地址:https://www.cnblogs.com/Alessandro/p/10011151.html