最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

為啥我的程序只能輸出總分,誰能幫我看看?。?!

#include <stdio.h>

int aboat(int score[])

{

? ? int i,all,anver;

? ? all=0;

? ? for(i=0;i<10;i++)

? ? {

? ? ? ? all+=score[i];

? ? }

? ? anver=all/10;

? ? printf("總分:%d\n",all);

? ? printf("平均分:%d\n",anver);

? ? return 0;

}

int paixu(int score[])

{

? ? int i,j,temp;

? ? for(i=8;i>=0;i--)

? ? {

? ? ? ? for(j=0;j<=j;j++)

? ? ? ? {

? ? ? ? ? ? if(score[j]<score[j+1])

? ? ? ? ? ? {

? ? ? ? ? ? ? ? temp=score[j];

? ? ? ? ? ? ? ? score[j]=score[j+1];

? ? ? ? ? ? ? ? score[j+1]=temp;

? ? ? ? ? ? ? ??

? ? ? ? ? ? }

? ? ? ? }

? ? }

? ? printf("最高分:%d\n",score[0]);

? ? printf("最低分:%d\n",score[9]);

? ? for(i=0;i<9;i++)

? ? {

? ? ? ? printf("排序:%d,",score[i]);

? ? }

? ? printf("%d",score[9]);

? ? return 0;

}

int main()

{

? ? int score[]={3,2,5,6,7,8,4,34,56,76};

? ? aboat(score);

? ? paixu(score);

? ? return 0;

? ??

}

? ??

? ??


正在回答

2 回答

paixu函數(shù)里面的嵌套for循環(huán)的子循環(huán):for(j=0;j<=j;j++),應(yīng)該是:for(j=0;j<=i;j++)

0 回復(fù) 有任何疑惑可以回復(fù)我~

for(j=0;j<=i;j++)

paixu函數(shù)? 雙層循環(huán),內(nèi)循環(huán) 看看

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

為啥我的程序只能輸出總分,誰能幫我看看?。?!

我要回答 關(guān)注問題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)