文件目录

#include <iostream>
using namespace std;
int main()
{
    int n;
    cin >> n;
    bool f[5050] = {}; // false 代表没输入过
    int a[20050] = {};
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
        if (f[a[i]] == false)
            f[a[i]] = true;
        else
            a[i] = 0;
    }
    for (int i = 0; i < n; i++)
        if (a[i] != 0)
            cout << a[i] << " ";
    return 0;
}