为什么测试输出的答案是对的,格式好像也没错但就是报PE???
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
bool compare(const string& num1, const string& num2) {
string s1 = num1 + num2;
string s2 = num2 + num1;
return s1 > s2;
}
int main() {
int T=2;
while (T--) {
int N;
cin >> N;
vector<string> nums(N);
for (int i = 0; i < N; ++i) {
cin >> nums[i];
}
sort(nums.begin(), nums.end(), compare);
for (const string& num : nums) {
cout << num;
}
cout << endl;
}
}