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