⛴李恒旭⚔♆§ • 2年前
using namespace std; int a, n[1005], b, k;
int main() {
cin >> a;
k = a;
for (int i = 1; i <= a; i++) {
cin >> b;
n[b]++;
if (n[b] != 1 && n[b] != 0) {
n[b] = 1;
k--;
}
}
cout << k << endl;
for (int i = 1; i <= 1000; i++) {
if (n[i] == 1) {
cout << i << ' ';
}
}
return 0;
}
评论:
请先登录,才能进行评论