hdfuhjudifkv

枫原万叶  •  1年前


include

using namespace std;

int main () {

int n, k, c = 0;
scanf("%d", &n);
int a[1001] = {0};
for (int i = 1; i <= n; i++) {

	cin >> k;
	if (a[k] == 0) {
		c++;
	}
	a[k]++;
}
cout << c << endl;
for (int i = 1; i <= 1000; i++) {
	if (a[i]) {
		cout << i << " ";
	}
}
return 0;

}


评论:

请先登录,才能进行评论