Gooooogle • 4个月前
#include <bits/stdc++.h>
using namespace std;
int main() {
list<int>s;
int n, x, z;
cin >> n >> x >> z;
for (int i = 0; i < n; i++) {
int y;
cin >> y;
s.push_back(y);
}
for (int i = 0; i < x; i++) {
s.pop_front();
}
for (int i = 0; i < z; i++) {
int y;
cin >> y;
s.push_back(y);
}
for (auto it = s.begin(); it != s.end(); it++) { //rend/rbegin
cout << *it << " ";
}
return 0;
}
评论:
请先登录,才能进行评论