题解 | #明明的随机数#
明明的随机数
https://www.nowcoder.com/practice/3245215fffb84b7b81285493eae92ff0
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> a(n);
for(int i=0;i<n;i++){
cin >> a[i];
}
sort(a.begin(),a.end());
cout << a[0] << endl;
for(int i=1; i<n; i++){
if(a[i] != a[i-1]) cout << a[i] << endl;
}
return 0;
}
// 64 位输出请用 printf("%lld")
查看14道真题和解析