大哥们能指教一下吗??这程序的思路
#include<stdio.h>int main(int argc, char* argv[])
{
struct student
{
int stuno;
int mathgrade;
int yuwengrade;
int enggrade;
} a[3];
int av_math = 0;
int av_yuwen = 0;
int av_eng = 0;
for ( int i = 0; i<3; i++)
{
printf("请输入第%d位同学的数据:\n", i + 1);
printf("请依次输入学号、数学成绩、语文成绩、英语成绩!\n");
scanf("%d %d %d %d", &a[i].stuno, &a[i].mathgrade, &a[i].yuwengrade, &a[i].enggrade);
}
printf("数据录入完毕!计算成绩中........\n");
for ( int j = 0; j<3; j++)
{
printf("学号为%d的同学的总成绩为:%d\n", a[j].stuno, a[j].mathgrade + a[j].yuwengrade + a[j].enggrade);
av_math = av_math + a[j].mathgrade;
av_yuwen = av_yuwen + a[j].yuwengrade;
av_eng = av_eng + a[j].enggrade;
}
printf("数学的平均成绩是:%d\n", av_math / 3);
printf("语文的平均成绩是:%d\n", av_yuwen / 3);
printf("英语的平均成绩是:%d\n", av_eng / 3);
return 0;
}