From bbfa2c6338903dbad73781c1a60404a0b257a008 Mon Sep 17 00:00:00 2001 From: pqzbgempc <2193876517@qq.com> Date: Wed, 20 Nov 2024 18:37:57 +0800 Subject: [PATCH] ADD file via upload --- xjxt2.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 xjxt2.cpp diff --git a/xjxt2.cpp b/xjxt2.cpp new file mode 100644 index 0000000..ee8de6b --- /dev/null +++ b/xjxt2.cpp @@ -0,0 +1,23 @@ +#include +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; +} +