#include <stdio.h>
int main(int argc, const char * argv[]) {
int a[20],b[20],n,count;
count=0;
int i=0;
int j;
printf("请输入你要输入的数字的个数");
scanf("%d",&n);
for (int i = 0; i<n; i++) {
scanf("%d",&a[i]);
}
for (i=0;i<n;i++) {
for (j=i+1; j<n; j++) {
if(a[i]!=a[j]){
b[i]=a[i];
}
else if(a[i]==a[j]){
count++;
}
}
}
for (i=0; i<n-count; i++) {
printf("%2d",b[i]);
}
return 0;
}
|
|