ADD file via upload

main
p5fohke9s 2 days ago
parent 54444d340b
commit c0a94bf559

36
b2.c

@ -0,0 +1,36 @@
#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;
}
Loading…
Cancel
Save