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.
37 lines
716 B
37 lines
716 B
6 days ago
|
#include<stdio.h>
|
||
|
int main()
|
||
|
{
|
||
|
struct Students
|
||
|
{
|
||
|
int num;
|
||
|
float score1;
|
||
|
float score2;
|
||
|
float score3;
|
||
|
float sum;
|
||
|
}students[3];
|
||
|
int i;
|
||
|
for (i = 0; i < 3; i++)
|
||
|
{
|
||
|
scanf("%d", &students[i].num);
|
||
|
scanf("%f", &students[i].score1);
|
||
|
scanf("%f", &students[i].score2);
|
||
|
scanf("%f", &students[i].score3);
|
||
|
students[i].sum= students[i].score1 + students[i].score2 + students[i].score3;
|
||
|
}
|
||
|
for (i = 0; i < 3; i++)
|
||
|
{
|
||
|
printf("%d %.1f %.1f %.1f %.1f\n",
|
||
|
students[i].num,
|
||
|
students[i].score1,
|
||
|
students[i].score2,
|
||
|
students[i].score3,
|
||
|
students[i].sum);
|
||
|
}
|
||
|
|
||
|
return 0;
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
|