亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

各位幫忙看一下!!


#include <stdio.h>

int i,j;

int sortscore(int socre[])

{

? ? int temp;

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

? ? {

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

? ? ? ? {

? ? ? ? ? ? if(score[i]<score[j])

? ? ? ? ? ? ? ?temp=score[i];

? ? ? ? ? ? ? ?score[i]=score[j];

? ? ? ? ? ? ? ?socre[j]=temp;

? ? ? ? }

? ? ? ? return socre;

? ? }

}

int sumscore(int score[])

{

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

? ? {

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

? ? }

? ? return sum;

? ? printf("考試成績總分為:%d\n",sum);

}

int maxscore(int score[]){

? ? printf("最高分為:%d\n",score[N-1]);

}

int minscore(int score[]){

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

}

int avagerscore(int score[]){

? ? int avager;

? ? avager=sum/N;

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

}

int main()

{

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

? ? sortscore(score);

? ? sumscore(score);

? ? maxscore(score);

? ? minscore(score);

? ? avagerscore(score);

? ? printf("考試成績降序排序為%d\n",score[]);

? ? return 0;

}

hello.c:?In?function?'sortscore':
hello.c:10:16:?error:?'score'?undeclared?(first?use?in?this?function)
?????????????if(score[i]


正在回答

1 回答

有個地方沒寫上,https://img1.sycdn.imooc.com//5b4d9de300017ef701570101.jpg

而且,你的排序是從大到小,最大值和最小值出錯了

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
C語言入門
  • 參與學習       927002    人
  • 解答問題       21533    個

C語言入門視頻教程,帶你進入編程世界的必修課-C語言

進入課程

各位幫忙看一下?。?/h1> 我要回答 關注問題

微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號