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
585 B
27 lines
585 B
#include <stdio.h>
|
|
typedef struct INFO
|
|
{
|
|
int num;
|
|
float Maths;
|
|
float Physics;
|
|
float English;
|
|
float sum;
|
|
}Info;
|
|
Info stu[3];
|
|
void info();
|
|
int main()
|
|
{
|
|
info();
|
|
}
|
|
void info()
|
|
{
|
|
for (int i = 0; i < 3; i++)
|
|
{
|
|
scanf("%d%f%f%f", &stu[i].num, &stu[i].Maths, &stu[i].Physics, &stu[i].English);
|
|
stu[i].sum = stu[i].Maths + stu[i].Physics + stu[i].English;
|
|
}
|
|
for (int i = 0; i < 3; i++)
|
|
{
|
|
printf("%d %.1f %.1f %.1f %.1f\n", stu[i].num, stu[i].Maths, stu[i].Physics, stu[i].English, stu[i].sum);
|
|
}
|
|
} |