我用选择法编了个排序的程序不晓得错在哪里了~`
#include <stdio.h>
void main()
{
int nA[10]={15,55,65,87,45,94,65,23,56,36};
int nIdex=0;
for (int nI = 0 ; nI < 10 ; nI ++)
{
for (int nJ = 0 ; nJ < 10-nI-1 ; nJ ++)
{
nIdex=nI;
if(nA[nIdex] < nA[nJ])
{
nIdex=nJ;
}
}
}
for (nI = 0 ; nI < 10 ; nI ++)
{
int nTemp = nA[nJ];
nA[nJ] = nA[nIdex];
nA[nIdex] = nTemp;
}
printf ("%\n",nA[nI]);
}