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

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

哪位大佬幫忙看看哪里錯(cuò)了


#include <stdio.h>

#define N 10

int totalscore(int score[])

{

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

? ? {

? ? ? ? int total=0;

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

? ? }

? ? return total;

}


int maxscore(int score[])

{

? ? int max=score[0];

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

? ? {

? ? ? ? if(score[i]>max)

? ? ? ? {

? ? ? ? ? ? max=score[i];

? ? ? ? }

? ? }

? ? return max;

}


int minscore(int score[])

{

? ? int min=score[0];

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

? ? {

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

? ? ? ? {

? ? ? ? ? ? min=score[i];

? ? ? ? }

? ? }

? ? return min;

}


int averagescore(int score[])

{

? ? int average;

? ? average=(totalscore(score))/10;

? ? return average;

}


void orderscore(int score[],N)

{

? ? for(int i=N-1;i>=0;i--)

? ? {

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

? ? ? ? {

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

? ? ? ? ? ? {

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

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

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

? ? ? ? ? ? }

? ? ? ? }

? ? }

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

? ? {

? ? printf("成績降序排列為:",score[i]);

? ? ? ??

? ? }

}




int main()

{

? ??

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

? ? int Total=totalscore(score);

? ? int Max=maxscore(score);

? ? int Min=minscore(score);

? ? int Average=averagescore(score);

? ??

? ? printf("總分為:%d",Total);

? ? printf("最高分為:%d",Max);

? ? printf("最低分為:%d",Min);

? ? printf("平均分為:%d",Average);

? ? order(score);

? ? return 0;

}


正在回答

2 回答

#include <stdio.h>

#define N 10

int totalscore(int score[])

{

? ? int total=0;//第1處修改

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

? ? {

? ? ? ? //int total=0;此處錯(cuò)誤1

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

? ? }

? ? return total;

}


int maxscore(int score[])

{

? ? int max=score[0];

? ? for(int i=1;i<N;i++)//此處錯(cuò)誤2

? ? {

? ? ? ? if(score[i]>max)

? ? ? ? {

? ? ? ? ? ? max=score[i];

? ? ? ? }

? ? }

? ? return max;

}


int minscore(int score[])

{

? ? int min=score[0];

? ? for(int i=1;i<N;i++)//此處錯(cuò)誤3

? ? {

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

? ? ? ? {

? ? ? ? ? ? min=score[i];

? ? ? ? }

? ? }

? ? return min;

}


double averagescore(int score[])

{

? ? double average;//此處錯(cuò)誤4,平均數(shù)最好用浮點(diǎn)數(shù)表示。

? ? average=(totalscore(score))/10.0;

? ? return average;

}


void orderscore(int score[],N)

{

? ? for(int i=N-1;i>=0;i--)

? ? {

? ? ? ? for(int j=1;j<=i;j++)//此處錯(cuò)誤5

? ? ? ? {

? ? ? ? ? ? if(score[j-1]<score[j])//此處錯(cuò)誤6

? ? ? ? ? ? {

? ? ? ? ? ? ? ? int temp;//此處錯(cuò)誤8

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

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

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

? ? ? ? ? ? }

? ? ? ? }

? ? }

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

? ? {

? ? printf("成績降序排列為:",score[i]);

? ? ? ??

? ? }

}




int main()

{

? ??

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

? ? int Total=totalscore(score);

? ? int Max=maxscore(score);

? ? int Min=minscore(score);

? ? double Average=averagescore(score);

? ??

? ? printf("總分為:%d",Total);

? ? printf("最高分為:%d",Max);

? ? printf("最低分為:%d",Min);

? ? printf("平均分為:%lf",Average);

? ? order(score);

? ? return 0;

}


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

#include <stdio.h>


int totalscore(int score[])

{

? ? int total=0;

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

? ? {

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

? ? }

? ? return total;

}


int maxscore(int score[])

{

? ? int max=score[0];

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

? ? {

? ? ? ? if(score[i]>max)

? ? ? ? {

? ? ? ? ? ? max=score[i];

? ? ? ? }

? ? }

? ? return max;

}


int minscore(int score[])

{

? ? int min=score[0];

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

? ? {

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

? ? ? ? {

? ? ? ? ? ? min=score[i];

? ? ? ? }

? ? }

? ? return min;

}


float averagescore(int score[])

{

? ? int average;

? ? average=(totalscore(score))/10;

? ? return average;

}


void orderscore(int score[])

{

? ? for(int i=9;i>=0;i--)

? ? {

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

? ? ? ? {

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

? ? ? ? ? ? {

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

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

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

? ? ? ? ? ? }

? ? ? ? }

? ? }

? ? printf("成績降序排列為:");

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

? ? {

? ??

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

? ? ? ??

? ? }

}




int main()

{

? ??

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

? ? int Total=totalscore(score);

? ? int Max=maxscore(score);

? ? int Min=minscore(score);

? ? int Average=averagescore(score);

? ??

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

? ? printf("最高分為:%d\n",Max);

? ? printf("最低分為:%d\n",Min);

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

? ? orderscore(score);

? ? return 0;

}


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

weixin_慕先生2217783 提問者

搞定了
2021-08-03 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

哪位大佬幫忙看看哪里錯(cuò)了

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

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

幫助反饋 APP下載

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

公眾號(hào)

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