C语言这个题怎么做谢谢谢谢谢谢
2个回答
展开全部
#include <stdio.h>
int main() {
double mark[4][3], aver[4], high[3] = {0};
int i, j;
for (i = 0; i < 4; i++) {
double all = 0.0;
printf ("请输入%c的三门成绩:\n", 'A'+i);
for (j = 0; j < 3; j++) {
scanf ("%lf", &mark[i][j]);
high[j] = high[j] < mark[i][j] ? mark[i][j] : high[j];
all += mark[i][j];
}
printf ("%c同学的平均成绩是:%.2lf\n", 'A'+i, all / 3);
}
printf ("三科的最高分分别为:%.2lf %.2lf %.2lf", high[0], high[1], high[2]);
return 0;
}
int main() {
double mark[4][3], aver[4], high[3] = {0};
int i, j;
for (i = 0; i < 4; i++) {
double all = 0.0;
printf ("请输入%c的三门成绩:\n", 'A'+i);
for (j = 0; j < 3; j++) {
scanf ("%lf", &mark[i][j]);
high[j] = high[j] < mark[i][j] ? mark[i][j] : high[j];
all += mark[i][j];
}
printf ("%c同学的平均成绩是:%.2lf\n", 'A'+i, all / 3);
}
printf ("三科的最高分分别为:%.2lf %.2lf %.2lf", high[0], high[1], high[2]);
return 0;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询