parent
69fbff79e9
commit
9ca477effa
@ -0,0 +1,25 @@
|
||||
#include<stdio.h>
|
||||
|
||||
struct stu_info
|
||||
{
|
||||
int num;
|
||||
float math,physics,english,total;
|
||||
} stu[3];
|
||||
|
||||
int main()
|
||||
{
|
||||
int i;
|
||||
for(i=0;i<3;i++)
|
||||
{
|
||||
scanf("%d",&stu[i].num);
|
||||
scanf("%f",&stu[i].math);
|
||||
scanf("%f",&stu[i].physics);
|
||||
scanf("%f",&stu[i].english);
|
||||
stu[i].total=stu[i].math+stu[i].physics+stu[i].english;
|
||||
}
|
||||
for(i=0;i<3;i++)
|
||||
{
|
||||
printf("%d %.1f %.1f %.1f\n",stu[i].num,stu[i].math,stu[i].physics,stu[i].english,stu[i].total);
|
||||
}
|
||||
return 0;
|
||||
}
|
Loading…
Reference in new issue