Home > Back-end >  There is a C function and sort of problem...
There is a C function and sort of problem...

Time:10-05


#include
#include
#include
Int main ()
{
Int a [10]={7, - 2,3,14, - 5, and 6,5,22, 4, 8}, b [10].
Int I, mid;
The FILE * fp.
}

CodePudding user response:

Give you an idea
First of all a are from small to large order of the elements in an array, and then traverse the elements of less than zero, and assign values to the b in the array on the left, in the same way, the rest of the elements in a store to the right side of the array b
Can use bubble sorting, write two times, a greater than (ascending), a less than (descending), using the if statement according to select ascending or descending order value
  • Related