代码:
//https://www.nowcoder.com/question/next?pid=1088888&qid=36829&tid=33502322
#include <iostream>
#include <bits/stdc++.h>
#include <string>
#include <map>
using namespace std;
int main(){
int number = 0; //这一组多少数
vector<int> nums;
map<int,int> cnt;
while(cin>>number){
// if(cin.get()=='\n') break;
// cout<<"number:"<<number<<endl;
cnt.clear();
nums.clear();
for(int i=0;i<number;i++){
int tmp;
cin>>tmp;
if(cnt.find(tmp)==cnt.end()){
cnt[tmp] = 1;
nums.push_back(tmp);
}
else{
continue;
}
}
int n = nums.size();
for(int i=n-1;i>=1;i--){
for(int j=0;j<i;j++){
if(nums[j] > nums[j+1]){
int a = nums[j];
nums[j] = nums[j+1];
nums[j+1] = a;
}
}
}
for(int i=0;i<n;i++){
cout<<nums[i]<<endl;
}
}
return 0;
}