简单,字符串模拟即可。
#include <bits/stdc++.h> #define FOR(i, l, r) for(int i = l; i <= r; i++) using namespace std; int t, l; string s[105]; int main() { cin >> t >> l; FOR(i, 1, t) cin >> s[i]; sort(s + 1, s + t + 1); FOR(i, 1, t) cout << s[i]; return 0; }
注册一个 HydroOJ 通用账户,您就可以在我们提供的所有在线评测服务上提交代码、参与讨论。
使用您的 HydroOJ 通用账户