nightelfel 2014-04-16 12:58:14
点我顶贴
收藏
删除
#include <stdio.h>
int n;
int i;
int temp;
int main() {
scanf("%d", &n);
char w[1001];
for (i=0;i<1001;i++) w[i]=0;
for (i=0;i<n;i++)
{
scanf("%d", &temp);
w[temp]=1;
}
temp=0;
for (i=0;i<1001;i++)
{
if (w[i]) temp++;
}
printf("%d\n", temp);
for (i=0;i<1001;i++)
{
if (w[i])
printf("%d ", i);
}
printf("\n");
}