AC

名字不要取太长像我这样应该刚刚好  •  23天前


不是你配吗 交时间:2024-10-10 20:27:14

运行 ID: 244723

include <bits/stdc++.h>

using namespace std; int n, a[1005], x, i = 0, sum;

int main() {

cin >> n;
while (i != n) {
	i++;
	cin >> x;
	if (a[x] != 1) {
		a[x] = 1;
		sum++;
	}
}
i = 0;
cout << sum << endl;
while (i != 1005) {
	if (a[i] > 0)
		cout << i << " ";
	i++;
}
return 0;

}


评论:

请先登录,才能进行评论