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.
27 lines
474 B
27 lines
474 B
1 year ago
|
#include<stdio.h>
|
||
|
|
||
|
struct stu_info
|
||
|
{
|
||
|
int num;
|
||
|
float math,physics,english,sum;
|
||
|
}
|
||
|
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].sum=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].sum);
|
||
|
}
|
||
|
return 0;
|
||
|
}
|