Home > Back-end >  The program can
The program can

Time:12-05

# include "stdio.h"
Int sort (char * p, int m)
{
int i;
Char change, * (p1, p2,
for(i=0; i<=m/2; I++)
{
P1=p + I;
The p2=p + (m - 1 - I);
Change=* p1;
* p1=* (p2);
* the p2=change;
}
}
The main ()
{
int i,n;
Char * p, num [20], temp.
Printf (" Enter n: ");
The scanf (" % d ", & amp; N);
Temp=getchar ();
Printf (" Enter num [0] num [1]... Num [% d] : ", n - 1);
For (I=0; iThe scanf (" % s ", & amp; Num [I]);
P=num.
Sort ();
Printf (" the Result is: \ n ");
for(i=0; iPrintf (" % s ", num [I]);
}

CodePudding user response:

Sort didn't preach to participate

CodePudding user response:

The
refer to the original poster Fqxxh response:
# include "stdio.h"
Int sort (char * p, int m)
{
int i;
Char change, * (p1, p2,
for(i=0; i<=m/2; I++)
{
P1=p + I;
The p2=p + (m - 1 - I);
Change=* p1;
* p1=* (p2);
* the p2=change;
}
}
The main ()
{
int i,n;
Char * p, num [20], temp.
Printf (" Enter n: ");
The scanf (" % d ", & amp; N);
Temp=getchar ();
Printf (" Enter num [0] num [1]... Num [% d] : ", n - 1);
For (I=0; iThe scanf (" % s ", & amp; Num [I]);
P=num.
Sort ();
Printf (" the Result is: \ n ");
for(i=0; iPrintf (" % s ", num [I]);
}

Learn the debugging techniques

CodePudding user response:

//# include "stdio.h" 
#include


Int sort (char * p, int m)
{
int i;
Char change, * (p1, p2,
for(i=0; i<=m/2; I++)
{
P1=p + I;
The p2=p + (m - 1 - I);
Change=* p1;
* p1=* (p2);
* the p2=change;
}

return 0;
}
//the main ()
Int main ()
{
int i,n;
Char * p, num [20], temp.

Printf (" Enter n: ");
The scanf (" % d ", & amp; N);
Temp=getchar ();
Printf (" Enter num [0] num [1]... Num [% d] : ", n - 1);
For (I=0; i//the scanf (" % s ", & amp; Num [I]);
The scanf (" % c ", & amp; Num [I]);
P=num.
Sort (p, n);
Printf (" the Result is: \ n ");
for(i=0; i//printf (" % s ", num [I]);
Printf (" % c ", num [I]);
return 0;
}

For your reference ~
  • Related