程序填空:去掉数组里的重复数字!
# include <stdio.h># define N 80
int fun(int a[], int n)
{
int i,t,j=0;
t=a[0];
for(i=1;i<n;i++)
if(__1__)
;
else
{
___2___;
t=a[i];
}
a[j++]=t;
return j;
}
main()
{
int a[N]={1,1,2,2,2,3,4,4,5,5,6,6,6,7,7,8,9,9,10,10}, i,n=20;
printf("The original data :\n");
for(i=0; i<n; i++)
printf("%4d",a[i]);
n=fun(a,n);
printf("\n\nThe data after deleted :\n");
for(i=0;i<n;i++)
printf("%4d",a[i]);
printf("\n ");
}
求解!!!!!!!!!