#include
Void main ()
{void swap (int * (p1, p2 int *);
Int I, n, j, k, a, [100].
Int * p;
P=a;
Printf (" input num: ");
The scanf (" % d \ n ", & amp; N);
for(i=0; i
for(j=0; j
for(k=0; k
Getch ();
}
Void swap (int * (p1, p2 int *)
{int p;
P=* p1; * p1=* (p2); * the p2=p;
}
CodePudding user response:
Sorting, dual cycle at leastCodePudding user response:
Cycle to write wrongCodePudding user response:
A single ranking results for loop must be not correctCodePudding user response:
for(j=0; jThis a loop, you can only make the smallest row in the front, plus a cycle in the loop, with respect to OK
For (I=0; I & lt; N - 1; I++)
{
for(j=0; J & lt; N; J++)
{
If (a [j] & gt; A [m + 1])
Swap ((p + j) and (p + j + 1));
}
}