题解 | #整型数组合并#
整型数组合并
https://www.nowcoder.com/practice/c4f11ea2c886429faf91decfaf6a310b
//https://www.nowcoder.com/practice/c4f11ea2c886429faf91decfaf6a310b?tpId=37&rp=1&ru=%2Fexam%2Foj%2Fta&qru=%2Fexam%2Foj%2Fta&sourceUrl=%2Fexam%2Foj%2Fta%3FtpId%3D37&difficulty=&judgeStatus=&tags=&title=80&gioEnter=menu
#include <iostream>
#include <vector>
#include <set>
using namespace std;
int main() {
int n = 0;
while (cin >> n) {
int m = 0;
int tem = 0;
set<int> ans;
for(int i = 0;i<n;i++){
cin >> tem;
ans.insert(tem);
}
cin >> m;
for(int i = 0;i<m;i++){
cin >> tem;
ans.insert(tem);
}
for(auto c:ans)
cout << c;
cout << endl;
}
}


小天才公司福利 1247人发布