commit 1b69c8b27b3a2172143296ce0e98e87b29e5d820 Author: 吴仁兵 <18408000516@stu.hut.edu.cn> Date: Fri Jan 11 21:28:11 2019 +0800 first commit diff --git a/wrbnb.cpp b/wrbnb.cpp new file mode 100644 index 0000000..92a18b6 --- /dev/null +++ b/wrbnb.cpp @@ -0,0 +1,137 @@ + +#include +#include +#include +struct singer +{ + char id[10]; + int rank; + char name[10]; + int score[10]; + float mark; +}; +int main(void) +{ + int i,b,j,s,n,t; + FILE *fp; + int sum,max,min; + struct singer a[5]; + + printf(" ֱϵͳ \n"); + printf(" ˵ \n"); + printf("1:ѡֱź\n"); + printf("2:ί\n"); + printf("3:ƽ\n"); + printf("4:ɼ\n"); + printf("5:дļ\n"); + printf("6:鿴ļ\n"); + printf("7:˳ϵͳ\n"); + printf(" "); + for( ; ;) + { + printf("ѡ"); + scanf("%d",&n); + switch(n) + { +case 1: + printf("ѡֱź\n"); + for(i=0;i<5;i++) + { + printf("%dѡֵıź:",i); + scanf("%s %s",a[i].id,a[i].name); + } + break; + +case 2: + printf("ί\n"); + printf("߷Ϊ100\n"); + for(i=0;i<5;i++) + { + printf("ί%dŸִ:\n",i); + for(j=0;j<5;j++) + { + printf("%dίִ:",j); + scanf("%d",&a[i].score[j]); + } + } + break; + +case 3: + for(i=0;i<5;i++) + { + max=a[i].score[0]; + min=a[i].score[0]; + sum=0; + for(j=0;j<5;j++) + { + + sum=sum+a[i].score[j]; + + if(a[i].score[j]>max) + { + max=a[i].score[j]; + } + if(a[i].score[j]