diff --git a/第五题.c b/第五题.c new file mode 100644 index 0000000..87a1802 --- /dev/null +++ b/第五题.c @@ -0,0 +1,108 @@ +#include +#include +#include +#include +void delete1(); +void order(); +void output(); +int sum=2; +struct stu +{ + int Id; + int clas; + char name[100]; + float score1; + float score2; + float score3; + float score; +}stu[100]={{10001,11,"Zhang",99.5,88.5,89.5,277.5}, +{10002,12,"Yang",77.9,56.5,87.5,221.9}, +{10003,11,"Liang",92.5,99.0,60.5,252}}; +int main() +{ + while(1) + { + order(); + output(); + delete1(); + } +} +void delete1() +{ + char b[100]; + scanf("%s",&b); + int c=-56356,f=1,len1,len=strlen(b); + if(b[0]>'0'&&b[0]<'9') + { + c=0; + for(int k=0;kstu[j].clas) + { + stu[sum+1]=stu[i]; + stu[i]=stu[j]; + stu[j]=stu[sum+1]; + } + else if(stu[i].clas==stu[j].clas) + { + if(stu[i].score