解题思路
1.简单模拟即可;
代码
#include<iostream>
#include <set>
using namespace std;
int main(){
int n;
cin >> n;
set<int> st;
while(n){
int t;
cin >> t;
st.insert(t);
n--;
}
int i = 0;
for(auto& num : st){
i++;
cout << num;
if(i < st.size()) cout << endl;
}
return 0;
}
京公网安备 11010502036488号