parent
e8351526d7
commit
9eb431fde4
@ -0,0 +1,22 @@
|
||||
#include<stdio.h>
|
||||
int main()
|
||||
{int i;
|
||||
struct Student
|
||||
{
|
||||
int num;
|
||||
float score1;
|
||||
float score2;
|
||||
float score3;
|
||||
float all;
|
||||
}student1,student2,student3;
|
||||
|
||||
scanf("%d%f%f%f",&student1.num,&student1.score1,&student1.score2,&student1.score3);
|
||||
scanf("%d%f%f%f",&student2.num,&student2.score1,&student2.score2,&student2.score3);
|
||||
scanf("%d%f%f%f",&student3.num,&student3.score1,&student3.score2,&student3.score3);
|
||||
student1.all = student1.score1 + student1.score2 + student1.score3;
|
||||
student2.all = student2.score1 + student2.score2 + student2.score3;
|
||||
student3.all = student3.score1 + student3.score2 + student3.score3;
|
||||
printf("%d %.1f %.1f %.1f %.1f\n",student1.num,student1.score1,student1.score2,student1.score3,student1.all);
|
||||
printf("%d %.1f %.1f %.1f %.1f\n",student2.num,student2.score1,student2.score2,student2.score3,student2.all);
|
||||
printf("%d %.1f %.1f %.1f %.1f\n",student3.num,student3.score1,student3.score2,student3.score3,student3.all);
|
||||
}
|
Loading…
Reference in new issue