第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

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

如果我只想算考試的總分,最高分,最低分,平均分最后要怎么打印出來

#include <stdio.h>? ??



int zf(int score)

{? ??

int score[10]={67,98,75,63,82,79,81,91,66,84};

int i ;

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

{

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

}

// printf("本次考試總分為:%d\n\n本次考試平均分為:%d\n\n", score[9] , score[9] / 10 ) ;

return 0 ;


}



int zg(int score[])

{

int j , max ;

max = score[0] ;

for(j = 1 ; j < 10 ; j++ )

{

if(score[j] > max)

{

max = score[j];

}

}

// printf("本次考試最高分為:%d\n\n" , max) ;

return 0;


}



int zd(int score[])

{

int k , min ;

min = score[0] ;

for(k = 0 ; k < 10 ; k++ )

{

if(score[k] < min )

{

min = score[k];

}

}

// printf("本次考試最低分為%d\n\n", b());

return min;


}



int main(){

int score[10]={67,98,75,63,82,79,81,91,66,84};

? ? //printf("本次考試總分為:%d\n\n本次考試平均分為:%d\n\n", zf(score) , pjf(score));

? ? printf("本次考試最高分為:%d\n\n" , zg(score));

? ? printf("本次考試最低分為%d\n\n" , zd(score));

? ??

? ? return 0;

}


正在回答

1 回答

由于任務(wù)要求里有一項(xiàng)是按高低項(xiàng)排序,所以排序后的數(shù)組,可以推出最大與最小值

我用的比較簡(jiǎn)單,直接輸出

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

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


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)