#include
#include
Int input (char ar2 [] [21]);
Void paixu (char ar2 [] [21], int n);
Void printArr (char ar2 [] [21], int n);
Int main (void)
{
Char arr [10] [21]={0};
Int n;
N=input (arr);
Paixu (arr, n);
PrintArr (arr, n);
return 0;
}
/* please fill in the answer here */
CodePudding user response:
His first writing, use the scanf % s or the fgets, either getchar () loopCodePudding user response:
Int input (char ar2 [] [21]){
int i=0;
While (i<10 & amp; & Ar2! END='* *')
{
Gets (ar2);
i++;
}
return i;
}
Void paixu (char ar2 [] [21], int n)
{
int i,j,t;
for(i=0; i
For (j=I + 1; j
If (ar2 [0] [m + 1] <=ar2 [j] [0])
{
T=ar2 [j] [0];
Ar2 [j] [0]=ar2 [j + 1] [0];
Ar2 [m + 1] [0]=t;
}
}
}
}
Void printArr (char ar2 [] [21], int n)
{
int i;
Char ch=' ';
for(i=0; i
If (I==(n - 1))
{ch='\ n'; }
Printf (" % d % c ", ar2 [I] [21], ch);
}
Return ar2;
}
In the wrong