哪位大神幫忙解釋一下這個(gè)排序的代碼?謝謝
void sort(int score[])
{
int i,j;
for(i=N-2;i>=0;i--)
{
for(j=0;j<=i;j++)
{
if(score[j]<score[j+1])
{
int temp;
temp = score[j];
score[j] = score[j+1];?
score[j+1]=temp;? ? ? ? ? ? ? ? ??
}? ? ? ? ? ? ? ? ?
}? ? ? ? ? ? ? ? ? ?
}
printScore(score);? ? ?
}
2021-01-30
跟冒泡排序差不多意思