'commit'
This commit is contained in:
23
LuoGu/RuMen/P1059_2.cpp
Normal file
23
LuoGu/RuMen/P1059_2.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
int N;
|
||||
int x;
|
||||
set<int> set1;
|
||||
cin >> N;
|
||||
//输入
|
||||
for (int i = 0; i < N; i++) {
|
||||
cin >> x;
|
||||
set1.insert(x);
|
||||
}
|
||||
//输出个数
|
||||
cout << set1.size() << endl;
|
||||
//迭代器.输出每一个数值
|
||||
set<int>::iterator it;
|
||||
for (it = set1.begin(); it != set1.end(); it++)
|
||||
cout << *it << " ";
|
||||
cout << endl;
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user