From 06fbf2de364bfcef57adcc1dbf4a26d1d7e570e4 Mon Sep 17 00:00:00 2001 From: powf2zncv <3313430869@qq.com> Date: Wed, 8 Nov 2023 18:48:25 +0800 Subject: [PATCH] Update README.md --- README.md | 362 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 361 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8da0a82..5e55ea3 100644 --- a/README.md +++ b/README.md @@ -121,4 +121,364 @@ scanf("%f",&student3.yy); printf("%d,%.1f,%.1f\n", student3.number, student3.add, student3.aver); -} \ No newline at end of file +} +步骤四 +#include +int num[4],cla[4]; +float f[4],s[4],t[4],add[4]; +int begin,sta; +int n=4; +int insert; +void sort(float add[]) +{ + int i,j,te; + float zh; + for(i=n-1;i>sta;i--) + { + if(add[i]>add[i-1]) + { + zh=add[i];add[i]=add[i-1];add[i-1]=zh; + te=num[i];num[i]=num[i-1];num[i-1]=te; + zh=f[i];f[i]=f[i-1];f[i-1]=zh; + zh=s[i];s[i]=s[i-1];s[i-1]=zh; + zh=t[i];t[i]=t[i-1];t[i-1]=zh; + } + } + if(n!=sta+1) + { + sta++; + sort(add);} +} + +void div(int clas[]) +{ + int i,j,te; + float zh; + for(i=0;iclas[i+1]) + { + te=clas[i];clas[i]=clas[i+1];clas[i+1]=te; + zh=add[i];add[i]=add[i+1];add[i+1]=zh; + te=num[i];num[i]=num[i+1];num[i+1]=te; + zh=f[i];f[i]=f[i+1];f[i+1]=zh; + zh=s[i];s[i]=s[i+1];s[i+1]=zh; + zh=t[i];t[i]=t[i+1];t[i+1]=zh; + } + } + if(n!=sta+1){ + n--; + div(clas);} + +} + +int main() +{ +void sort(float add[]); +void div(int clas[]); +num[0]=10001;num[1]=10002;num[2]=10003; +cla[0]=11;cla[1]=12;cla[2]=11; +f[0]=99.5;f[1]=77.9;f[2]=92.5; +s[0]=88.5;s[1]=56.5;s[2]=99.0; +t[0]=89.5;t[1]=87.5;t[2]=60.5; +for(int i=0;i<3;i++) +{ + add[i]=f[i]+s[i]+t[i]; +} +scanf("%d",&num[3]); +insert=num[3]; +int in=num[3]; +for(int i=0;i<3;i++){ + if(in==num[i]){ + printf("%d %d %f %f %f %f",num[i],cla[i],f[i],s[i],t[i],add[i]); + return 0; + } +} +scanf("%d",&cla[3]); +scanf("%f",&f[3]); +scanf("%f",&s[3]); +scanf("%f",&t[3]); +add[3]=f[3]+s[3]+t[3]; +sta=0;begin=0; +div(cla); +n=4; +int m; +for(m=0;m +#include +#include +int num[4],cla[4]; +float f[4],s[4],t[4],add[4]; +int begin,sta; +int n=3; +int insert; +char name[4][10]={{"Zhang"},{"Yang"},{"Liang"}}; +void sort(float add[]) +{ + int i,j,te; + float zh; + char oo[10]; + for(i=n-1;i>sta;i--) + { + if(add[i]>add[i-1]) + { + zh=add[i];add[i]=add[i-1];add[i-1]=zh; + te=num[i];num[i]=num[i-1];num[i-1]=te; + zh=f[i];f[i]=f[i-1];f[i-1]=zh; + zh=s[i];s[i]=s[i-1];s[i-1]=zh; + zh=t[i];t[i]=t[i-1];t[i-1]=zh; + strcpy(oo,name[i]);strcpy(name[i],name[i-1]); + strcpy(name[i-1],oo); + } + } + if(n!=sta+1) + { + sta++; + sort(add);} +} + +void div(int clas[]) +{ + int i,j,te; + float zh; + char oo[10]; + for(i=0;iclas[i+1]) + { + te=clas[i];clas[i]=clas[i+1];clas[i+1]=te; + zh=add[i];add[i]=add[i+1];add[i+1]=zh; + te=num[i];num[i]=num[i+1];num[i+1]=te; + zh=f[i];f[i]=f[i+1];f[i+1]=zh; + zh=s[i];s[i]=s[i+1];s[i+1]=zh; + zh=t[i];t[i]=t[i+1];t[i+1]=zh; + strcpy(oo,name[i]);strcpy(name[i],name[i+1]); + strcpy(name[i+1],oo); + } + } + if(n!=sta+1){ + n--; + div(clas);} + +} + + +int main() +{ +void sort(float add[]); +void div(int clas[]); +num[0]=10001;num[1]=10002;num[2]=10003; +cla[0]=11;cla[1]=12;cla[2]=11; +f[0]=99.5;f[1]=77.9;f[2]=92.5; +s[0]=88.5;s[1]=56.5;s[2]=99.0; +t[0]=89.5;t[1]=87.5;t[2]=60.5; +sta=0;begin=0; +div(cla); +n=3; +int m; +for(m=0;m='0'&&name[3][0]<='9') + { + int number=atoi(name[3]); + for(int i=0;i<3;i++){ + if(number==num[i]){ + printf("Are you sure?"); + exist=1; + target=i; + break; + } + } + } + else + { + for(int i=0;i<3;i++){ + if(strcmp(name[i],name[3])); + else{ + printf("Are you sure?\n"); + exist=1; + target=i; + break; + } + } + } + char ch; + if(exist==1){ + scanf(" %c",&ch); + if(ch=='y'){ + for(int i=0;i<3;i++){ + if(i!=target){ + printf("%d %d %s %.2f %.2f %.2f\n",num[i],cla[i],name[i],f[i],s[i],t[i]); + } + } + } + if(ch=='n'){ + for(int i=0;i<3;i++){ + printf("%d %d %s %.2f %.2f %.2f\n",num[i],cla[i],name[i],f[i],s[i],t[i]); + } + } + } + else{ + for(int i=0;i<3;i++){ + printf("%d %d %s %.2f %.2f %.2f\n",num[i],cla[i],name[i],f[i],s[i],t[i]); + } + } + return 0; + } +步骤六 +#include +#include +#include +int num[4],cla[4]; +float f[4],s[4],t[4],add[4]; +int begin,sta; +int n=3; +int insert; +char name[4][10]={{"Zhang"},{"Yang"},{"Liang"}}; +void sort(float add[]) +{ + int i,j,te; + float zh; + char oo[10]; + for(i=n-1;i>sta;i--) + { + if(add[i]>add[i-1]) + { + zh=add[i];add[i]=add[i-1];add[i-1]=zh; + te=num[i];num[i]=num[i-1];num[i-1]=te; + zh=f[i];f[i]=f[i-1];f[i-1]=zh; + zh=s[i];s[i]=s[i-1];s[i-1]=zh; + zh=t[i];t[i]=t[i-1];t[i-1]=zh; + strcpy(oo,name[i]);strcpy(name[i],name[i-1]); + strcpy(name[i-1],oo); + } + } + if(n!=sta+1) + { + sta++; + sort(add);} +} + +void div(int clas[]) +{ + int i,j,te; + float zh; + char oo[10]; + for(i=0;iclas[i+1]) + { + te=clas[i];clas[i]=clas[i+1];clas[i+1]=te; + zh=add[i];add[i]=add[i+1];add[i+1]=zh; + te=num[i];num[i]=num[i+1];num[i+1]=te; + zh=f[i];f[i]=f[i+1];f[i+1]=zh; + zh=s[i];s[i]=s[i+1];s[i+1]=zh; + zh=t[i];t[i]=t[i+1];t[i+1]=zh; + strcpy(oo,name[i]);strcpy(name[i],name[i+1]); + strcpy(name[i+1],oo); + } + } + if(n!=sta+1){ + n--; + div(clas);} + +} + + +int main() +{ +void sort(float add[]); +void div(int clas[]); +num[0]=10001;num[1]=10002;num[2]=10003; +cla[0]=11;cla[1]=12;cla[2]=11; +f[0]=99.5;f[1]=77.9;f[2]=92.5; +s[0]=88.5;s[1]=56.5;s[2]=99.0; +t[0]=89.5;t[1]=87.5;t[2]=60.5; +sta=0;begin=0; +div(cla); +n=3; +int m; +for(m=0;m