题解 | #迭代器遍历set#
#include<bits/stdc++.h>
using namespace std;
int main(){
set<int>s;
// write your code here......
int num;
while(cin >> num) {
s.insert(num);
}
for(auto v : s) {
cout << v << " ";
}
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main(){
set<int>s;
// write your code here......
int num;
while(cin >> num) {
s.insert(num);
}
for(auto v : s) {
cout << v << " ";
}
return 0;
}
相关推荐