From ad05f1f5e7810478199d19b3d9c3c535acd8d313 Mon Sep 17 00:00:00 2001 From: p9r5svm3g <2687957063@qq.com> Date: Sat, 11 Nov 2023 14:49:50 +0800 Subject: [PATCH] ADD file via upload --- program 2.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 program 2.c diff --git a/program 2.c b/program 2.c new file mode 100644 index 0000000..9941021 --- /dev/null +++ b/program 2.c @@ -0,0 +1,25 @@ +#include + +struct stu +{ + int num; + float m,p,e,s; +} stu[3]; + +int main() +{ + int i; + for(i=0;i<3;i++) + { + scanf("%d",&stu[i].num); + scanf("%f",&stu[i].m); + scanf("%f",&stu[i].p); + scanf("%f",&stu[i].e); + stu[i].s=stu[i].m+stu[i].p+stu[i].e; + } + for(i=0;i<3;i++) + { + printf("%d %.1f %.1f %.1f %.1f\n",stu[i].num,stu[i].m,stu[i].p,stu[i].e,stu[i].s); + } + return 0; +}