Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Enter an integer array with a length of 20, delete the repeated elements in the array (if there are three zeros, delete the last two), and output after pruning.
Enter an integer array with a length of 20, delete the repeated elements in the array (if there are three zeros, delete the last two), and output after pruning.
# include & ltstdio.h & gt

Invalid? Master ()

{

int? a[20];

int? Length = 20;

int? I,j;

Printf ("Please enter 20 digits");

for(I = 0; I & lt20; i++)

{

scanf("%d ",& ampa[I]);

}

for(I = 0; I< length-1; i++)

{?

for(j = I+ 1; J< length; j++)

{

if(a[i]==a[j])

{

int? k;

Length = length-1;

for(k = j; K< length; k++)

a[k]= a[k+ 1];

}

}

}

for(I = 0; I < length; i++)

printf("%d\n ",a[I]);

} The procedure is correct and the answer is not easy. I hope it can be adopted.