秒
2024-07-30 20:56:23
发布于:上海
3阅读
0回复
0点赞
#include<iostream>
#include<set>
using namespace std;
set<int> se_Deduplication;
int main(void){
int n;
int cnt=0;
cin>>n;
while(n--){
int x;
cin>>x;
se_Deduplication.insert(x);
}
set<int>::iterator it_iterations=se_Deduplication.begin();
for(;it_iterations!=se_Deduplication.end();it_iterations++){
cnt++;
}
cout<<cnt<<"\n";
it_iterations=se_Deduplication.begin();
for(;it_iterations!=se_Deduplication.end();it_iterations++){
cout<<*it_iterations<<" ";
}
return 0;
}
这里空空如也
有帮助,赞一个