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

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

為什么我的第一個輸出還有那么一段數(shù)字啊,而第二個就沒有,急求

為什么我的第一個輸出還有那么一段數(shù)字啊,而第二個就沒有,急求

C
One祺_看世界 2016-04-14 21:23:00
/*在一個長度為10的整型數(shù)組里面,保存了班級10個學(xué)生的考試成績。要求編寫5個函數(shù),分別實現(xiàn)計算考試的總分,最高分,最低分,平均分和考試成績降序排序。*/#include<stdio.h>//總分int addCount(int score[])//注意函數(shù)中數(shù)組如何作為形參{ int i,sum=0;//要給sum賦初值 for(i=0;i<10;i++) { sum +=score[i]; } return sum;}//平均成績float avgCount(int score[]){ float avg; avg = float(addCount(score)/10); return avg;}//最高分int maxCount(int score[]){ int i; int max = score[0];//比較大小的時候要引入一個中間變量,作為媒介 for(i=0;i<10;i++) { if(max<score[i]) { max = score[i]; } } return max;}//最低分int minCount(int score[]){ int i; int min = score[0]; for(i=0;i<10;i++) { if(min>score[i]) { min = score[i]; } } return min;}//考試成績降序int sort(int score[]){ int i,j,mid; for(i=0;i<10;i++) { for(j=0;j<10;j++) { if(score[j]<score[j+1]) { mid = score[j]; score[j] = score[j+1]; score[j+1] = mid; } } } printf("排序的序列為:"); for(i=0;i<10;i++) { printf("%d\t",score[i]); } return 0;}//主函數(shù)int main(){? ? int score[10]={67,98,75,63,82,79,81,91,66,84}; printf("考試的總分為:%d\n",addCount(score)); printf("考試的平均分為:%lf\n",avgCount(score)); printf("考試的最高分為:%d\n",maxCount(score)); printf("考試的最低分為:%d\n",minCount(score)); printf("考試成績降序排序為:",sort(score));? ? return 0;}//分?jǐn)?shù)降序排序?void sort(int score[]){ int i,j; for(i=N-2;i>=0;i--) { for(j=0;j<=i;j++) { if(score[j]<score[j+1]) { int temp; temp = score[j]; score[j] = score[j+1];? score[j+1]=temp; ? ? ? ? ? ? ? ? ? } ? ? ? ? ? ? ? ?? } ? ? ? ? ? ? ? ? ?? } printScore(score); ? ??}?
查看完整描述

1 回答

?
qq___524

TA貢獻171條經(jīng)驗 獲得超74個贊

這不是完整的代碼吧

查看完整回答
反對 回復(fù) 2016-04-14
點擊展開后面1
  • 1 回答
  • 0 關(guān)注
  • 1364 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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