From 643f0e3d01ef8a4102e5b95833c5c9db4c75895d Mon Sep 17 00:00:00 2001 From: p7cx2jokr <2160925370@qq.com> Date: Thu, 21 Nov 2024 11:09:15 +0800 Subject: [PATCH] ADD file via upload --- 2.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 2.c diff --git a/2.c b/2.c new file mode 100644 index 0000000..d4a35d5 --- /dev/null +++ b/2.c @@ -0,0 +1,32 @@ +#include +struct student{ + char id[20]; + double score1,score2,score3,total; +}s[10]; + +void input(){ + int i; + for(i=0;i<3;i++){ + scanf("%s%lf%lf%lf",s[i].id,&s[i].score1,&s[i].score2,&s[i].score3); + s[i].total=s[i].score1+s[i].score2+s[i].score3; + } + for(i=0;i<3;i++){ + printf("%s %.1f %.1f %.1f %.1f\n",s[i].id,s[i].score1,s[i].score2,s[i].score3,s[i].total); + } +} +int main(){ + input(); + return 0; +} +//10001 +//85.0 +//99.0 +//77.5 +//10002 +//88.5 +//88.5 +//90.0 +//10003 +//66.0 +//78.5 +//89.5