我极限了
2024-06-02 16:00:08
发布于:广东
9阅读
0回复
0点赞
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> A(N), B(N),sums;
for (int i = 0; i < N; ++i) cin >> A[i];
for (int i = 0; i < N; ++i) {
cin >> B[i];
for (int j = 0; j < N-1; ++j) {
sums.push_back(B[i] + A[j]);
}
}
sort(sums.begin(), sums.end());
for (int i = 0; i < N; ++i) cout << sums[i] << " ";
return 0;
}
这里空空如也
有帮助,赞一个