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.
24 lines
382 B
24 lines
382 B
#include <stdio.h>
|
|
struct s {
|
|
int num;
|
|
float m;
|
|
float p;
|
|
float e;
|
|
};
|
|
int main()
|
|
{
|
|
struct s stu[3];
|
|
int i;
|
|
float sum;
|
|
for(i=0;i<3;i++)
|
|
scanf("%d %f %f %f",&stu[i].num,&stu[i].m,&stu[i].p,&stu[i].e);
|
|
|
|
for(i=0;i<3;i++)
|
|
{
|
|
sum=stu[i].m+stu[i].p+stu[i].e;
|
|
printf("%d %.1f %.1f %.1f %.1f\n",stu[i].num,stu[i].m,stu[i].p,stu[i].e,sum);
|
|
}
|
|
return 0;
|
|
}
|
|
|