C语言问题,急!!!!!!!!!!!!!!!!!!在线等答案

来源:百度知道 编辑:UC知道 时间:2024/05/15 10:51:59
int main()
{输入上学期课程成绩,保存在数组中调用函数getMax(int score,int n)得到最大成绩并输出
使用if… else if…else if …或者switch判断平时成绩区间[100,90],(90,80],(80,70],(70,60],(60,0]并输出不同语句}
int getMax(int score,int n){for循环得到最大值,返回给main}
int getMin(int *score,int n) {for循环得到最小值,返回给main}
int getAve(int score,int n){do-while得到和,计算出平均值返回给main}

解题思路不是已经写出来了吗?

你是要原代码吗?
你的题目表达的不清楚;不知道是否符合你的意思

#include<stdio.h>
int getMax(int score[],int n);
int getMin(int score[],int n);
int getAve(int score[],int n);
int main()
{
int score[10];
int i;
for(i=0;i<10;i++) //输入10个成绩
{
scanf("%d",&score[i]);
}
printf("最大值:");
printf("%d",getMax(score,10));
printf("最小值:");
printf("%d",getMin(score,10));
printf("平均值:");
printf("%d",getAve(score,10));
int avg=getAve(score,10);
if(avg<=100&&avg>=90)
{
printf("平均在[90,100]");
}
else if(avg>=80)
{
printf("平均在[80,90]");
}
else if(avg>=80)
{
printf("平均在[70,80]");
}
else if(avg&g