降序排序的第一個(gè)循環(huán)的i=N-2是什么意思
//分?jǐn)?shù)降序排序
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);????
}
2020-06-12
不是太懂。
2020-06-09
可以參考一下前面的冒泡排序
2020-06-02
可以參考一下前面的冒泡排序