题解 | #整型数组合并#
整型数组合并
http://www.nowcoder.com/practice/c4f11ea2c886429faf91decfaf6a310b
#include<iostream>
#include<set>
#include<algorithm>
#include<vector>
using namespace std;
bool cmp(const int &a,const int &b)
{
return a>b;
}
int main()
{
int d;
while(cin>>d)
{
set<int>s;
while(d--)
{
int data;
cin>>data;
s.insert(data);
}
cin>>d;
while(d--)
{
int data;
cin>>data;
s.insert(data);
}
// sort(s.begin(),s.end(),cmp);
set<int>::iterator iter;
iter=s.begin();
while(iter!=s.end())
{
cout<<*iter;
iter++;
}
cout<<endl;
}
return 0;
}