#include<bits/stdc++.h>
using namespace std;
int a[100000];
bool s[100000];
int main()
{
int n;
cin >> n;
memset(s, true, sizeof(s));
for(int i = 1; i <= n; i++) cin >> a[i];
for(int i = 1; i <= n;+i++)
{
if(s[i])
for(int j = i+1; j <= n; j++){
if(a[i] == a[j]) s[j]=false;
}
}
for(int i = 1; i <= n; i ++)
{
if(s[i] == true) cout<<a[i]<<" ";
}
return 0;
}
整数去重 (数组)
最新推荐文章于 2024-06-29 22:05:14 发布