From 36e8ad02c3922584078966e7419e9e19da5e7ca3 Mon Sep 17 00:00:00 2001 From: p7cx2jokr <2160925370@qq.com> Date: Fri, 22 Nov 2024 22:11:42 +0800 Subject: [PATCH] ADD file via upload --- 8.c | 173 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100644 8.c diff --git a/8.c b/8.c new file mode 100644 index 0000000..d6b1077 --- /dev/null +++ b/8.c @@ -0,0 +1,173 @@ +#include +#include +int cnt=0; +struct student{ + int clas; + char id[20],name[20]; + double score1,score2,score3,total; +}s[10]; + +void input(){ + while(1){ + printf("Id "); + scanf("%s",s[cnt].id); + printf("class "); + scanf("%d",&s[cnt].clas); + printf("name "); + scanf("%s",s[cnt].name); + printf("score1 "); + scanf("%lf",&s[cnt].score1); + printf("score2 "); + scanf("%lf",&s[cnt].score2); + printf("score3 "); + scanf("%lf",&s[cnt].score3); + s[cnt].total=s[cnt].score1+s[cnt].score2+s[cnt].score3; + cnt++; + printf("continue?\n"); + char ans[10]; + scanf("%s",ans); + if(strcmp(ans,"no")==0) break; + } +} + +void del(){ + while(1){ + char str[20]; + scanf("%s",str); + int i=find(str); + if(i!=-1){ + for(;is[j+1].clas||(s[j].clas==s[j+1].clas&&s[j].total