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

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

大神幫忙看一下哪里不對??

#include <stdio.h>


int main()

{

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

? ? int i,j,temp;

? ? int max=0;//最大數(shù)

? ? int min=score[0];//最小數(shù)

? ? int num=0;//總數(shù)

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

? ? {

? ? ? ? for(j=9;j>=i;j--)

? ? ? ? if(score[j]>score[j-1])

? ? ? ? {

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

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

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

? ? ? ? ? ??

? ? ? ? }

? ? }

? ? int paixu()//平均數(shù)

? ? {

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

? ? ? ? {num=num+score[i];

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

? ? ? ? return 1;

? ? ? ? }

? ? }

? ? max=score[0];

? ?min=score[9];

? ? float pj=num/10;

? ??

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

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

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

? ? printf("平均分為%2f\n",pj);

? ? printf("考試成績降序排序?yàn)?);

? ? paixu();

? ? ? ?

? ? return 0;

}


正在回答

3 回答

自己寫的? ?你可以看一下? 可能不是很簡單? ?但是容易看懂

#include <stdio.h>

#define N 10

int a (int score[])

{

? ? int i,sum=0;

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

? ? {

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

? ? }

? ? return sum ;

}


int b (int score[])

{

? ? int max,i;

? ? max=score[0];

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

? ? {

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

? ? ? ? {

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

? ? ? ? }

? ? }

? ? return max;

}


int c (int score[])

{

? ? int mix,i;

? ? mix=score[0];

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

? ? {

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

? ? ? ? {

? ? ? ? ? ? mix=score[i];

? ? ? ? }

? ? }

? ? return mix;

}


float d (int score[])

{

? ? int Average;

? ? return Average=a(score)/N;

}


void e (int score[])

{

? ? int i,j,drop;

? ? for(j=0;j<N-1;j++)

? ? {

? ? ? ? for(i=0;i<N-1;i++)

? ? ? ? {

? ? ? ? ? ? if(score[i]>score[i+1])

? ? ? ? ? ? {

? ? ? ? ? ? ? ? drop=score[i];

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

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

? ? ? ? ? ? }

? ? ? ? }

? ? }

}


int main()

{

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

? ? int i;

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

? ? printf("最高:%d\n",b(score));

? ? printf("最低:%d\n",c(score));

? ? printf("平均:%1.1f\n",d(score));

? ? printf("降序:");

? ? e(score);

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

? ? {

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

? ? }

? ??

? ? return 0;

}


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

int paixu()? ? 首先你吧子函數(shù)? ?放在主函數(shù)里就不對。。。。。。。。

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

你的代碼寫的有點(diǎn)亂,題目是要求寫5個(gè)函數(shù)的


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

舉報(bào)

0/150
提交
取消

大神幫忙看一下哪里不對??

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

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

幫助反饋 APP下載

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

公眾號

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