You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
559 B

#include <stdio.h>
struct Student
{
int num;
float a;
float b;
float c;
float d;
} ;
int main()
{ int i,j;
struct Student stu[3];
for(i=0;i<3;i++)
{
scanf("%d%f%f%f",&stu[i].num,&stu[i].a,&stu[i].b,&stu[i].c);
}
stu[0].d=stu[0].a+stu[0].b+stu[0].c;
stu[1].d=stu[1].a+stu[1].b+stu[1].c;
stu[2].d=stu[2].a+stu[2].b+stu[2].c;
for(j=0;j<3;j++)
{
printf("学号 %d 高数成绩 %.1f 大学物理成绩 %.1f 英语成绩 %.1f 总成绩 %.1f\n",stu[j].num,stu[j].a,stu[j].b,stu[j].c,stu[j].d);
}
}