Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Design a C language program, and put all elements less than 0 in the plastic array in front of all elements greater than 0.
Design a C language program, and put all elements less than 0 in the plastic array in front of all elements greater than 0.
This code is used for sorting and can also meet your requirements.

# include & ltstdio.h & gt

int main()

{

int a[ 15]={ 1,3,5,0,- 1,-5,- 10,4,-6,67,54,44,-76,-70,-66 };

int i,j,m;

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

{

for(j = I+ 1; j & lt 15; j++)

if(a[I]& gt; a[j])

{

m = a[I];

a[I]= a[j];

a[j]= m;

}

}

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

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

getchar();

Returns 0;

}