文章
13
粉丝
120
获赞
1
访问
6.4k
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
using namespace std;
int main()
{
int n, x;
cin >> n;
set<int> s;
vector<int> nums;
for (int i = 0; i < n; i++)
{
cin >> x;
nums.push_back(x);
s.insert(x);
}
sort(nums.begin(), nums.end());
for (auto i = nums.begin(); i != nums.end(); i++)
cout << *i << " ";
cout << endl;
for (auto i = s.begin(); i != s.end(); i++)
cout << *i << " ";
cout << endl;
}
登录后发布评论
暂无评论,来抢沙发