CodePudding user response:
Reference:# include & lt; Stdio. H>
# define 40 N
Parr void reswap (int * and an int n);
Int main ()
{
Int score [N], N, I;
Printf (" The number of student: ");
The scanf (" % d ", & amp; n);
Printf (" Input student 's score: "% d, n);
for(i=0; i{
The scanf (" % d ", & amp; Score [I]);
}
Reswap (score, n);
return 0;
}
Parr void reswap (int * and an int n)
{
Int I, j, temp.
for(i=0; i{
for(j=i+1; j{
If (* (parr + I) & lt; * (parr + j))//from big to small
{
Temp=* (parr + I);
* (parr + I)=* (parr + j);
* (parr + j)=temp;
}
}
}
for(i=0; i{
Printf (" % d ", * (parr + I));
}
printf("\n");
}