#include <stdio.h>
/*produce some numbers not bigger than ten
and change the content to The simple one*/
#include<time.h>
#define N 20
int main()
{
int N1[N];//define an array
int i1 = 0, i2 = 0, i4 = 0, j = 0;//define the control variable.
for (i1 = 0; i1 < N; i1++)/*Input the local array*/
N1[i1] = rand() % 10;
for (i1 = 0; i1 < N; i1++)/*Output the localarray*/
printf("%d\t", N1[i1]);
putchar('\n');
for (i1 = 0, i2 = 0; i1 < N - i2;++i1)/*Change the array to
fit the demand*/
{
i4 = i1 + 1;
for (; i4 < N - i2; ++i4)/*Delete the repeated ones*/
if (N1[i1] == N1[i4])/*Tell the difference and change it.*/
{
for (j = i4; j < N - i2 ; j++)
N1[j] = N1[j + 1];
++i2;
--i4;
}
}
for (j = 0; j <N-i2; ++j)/*Output the new array.*/
printf("%d\t", N1[j]);
return 0;
}