#include<stdio.h>
#include<stdlib.h>
typedef struct student{
int cla;
char name[10];
int score[3];
int avg;
} stu;
void main()
{
int i,j,k,n;
scanf("%d", &n);
stu a[n], buf;
for(i=0;i<n;i++)
{
scanf("%d%s",&a[i].cla,a[i].name);
int sum = 0;
for (j=0; j<3; ++j)
{
scanf("%d",&a[i].score[j]);
sum += a[i].score[j];
}
a[i].avg = sum/3.0;
}
for(i=0;i<n;i++)
{
printf("The average score of the %dth student is %d.\n",i+1,a[i].avg);
}
}
您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!如有帮助,请点击我的回答下方的【采纳该答案】按钮帮忙采纳下,谢谢!