From b1fdc82907e2f0ccdd24c6b69ec5d331d51fd1ff Mon Sep 17 00:00:00 2001 From: p7cx2jokr <2160925370@qq.com> Date: Thu, 21 Nov 2024 11:09:01 +0800 Subject: [PATCH] ADD file via upload --- 4.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 4.c diff --git a/4.c b/4.c new file mode 100644 index 0000000..db5dfb8 --- /dev/null +++ b/4.c @@ -0,0 +1,48 @@ +#include +#include +struct student{ + int clas,inserted; + char id[20]; + double score1,score2,score3,total; +}s[10]; + +void input(){ + int i,j,cnt=0; + for(i=0;i<4;i++){ + scanf("%s%d%lf%lf%lf",s[i].id,&s[i].clas,&s[i].score1,&s[i].score2,&s[i].score3); + cnt++; + if(i!=3) s[i].inserted=0; + else s[i].inserted=1; + for(j=0;js[j+1].clas||(s[j].clas==s[j+1].clas&&s[j].total