文章
61
粉丝
137
获赞
18
访问
40.0k
#include<bits/stdc++.h>
using namespace std;
int main(){
int n, tmp;
while(cin >> n){
int arr[n];
int judge[n];
for(int i = 0; i < n; i++){
cin >> arr[i];
judge[i] = 1;
}
for(int i = 0; i < n-1; i++){
if(judge[i] == 1){
for(int j = i+1; j < n; j++){
if(arr[j] == arr[i])
judge[j] = 0;
}
}
}
for(int i = 0; i < n; i++){
if(judge[i] == 1)
cout << arr[i] << " ";
}
cout << endl;
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发