#牛客春招刷题训练营# https://www.nowcoder.com/discuss/727521113110073344
使用set集合去重,同时set默认就是从小到大排序,直接使用auto输出即可
#include <iostream>
#include <set>
#include <algorithm>
using namespace std;
int main() {
int n;
cin >> n;
set<int> st;
for(int i = 0 ; i < n ; i ++) {
int x;cin>>x;
st.insert(x);
}
for(auto x : st) {
cout << x <<endl;
}
}
// 64 位输出请用 printf("%lld")



京公网安备 11010502036488号