commit ad0423d776d4b1aceb532c367b52f230d62c186a Author: Your Name Date: Wed Jan 9 18:39:26 2019 +0800 A diff --git a/歌手比赛系统1.cpp b/歌手比赛系统1.cpp new file mode 100644 index 0000000..be55df5 --- /dev/null +++ b/歌手比赛系统1.cpp @@ -0,0 +1,186 @@ +#include +#include +#include + +#define N 100 /*¸èÊÖÈËÊý×î¶à100ÈË*/ +#define M 10 /*ÆÀίÈËÊý10ÈË*/ + + struct player + { + int num; /*¸èÊÖ±àºÅ*/ + char name[100]; /*¸èÊÖÐÕÃû*/ + int score[10]; /*ÆÀί´ò·Ö³É¼¨*/ + float ave; /*¸èÊÖµÄƽ¾ù·Ö*/ + int index; + }singer[M]; + +void f1(struct player singer[],int n) /*f1ÊÇÊäÈëÑ¡ÊÖÐÅÏ¢µÄº¯Êý*/ +{ +int i; +for(i=0;isinger[i].score[j]) + Min[i]=singer[i].score[j]; + } + singer[i].ave=(sum[i]-Max[i]-Min[i])/(M-2); + } + for(i=0;isinger[k].ave) + k=j; + temp=singer[k]; + singer[k]=singer[i]; + singer[i]=temp; + + } + printf("¸÷λ¸èÊÖ°´Æ½¾ù·Ö½øÐÐÅÅÐò´Ó¸ßµ½µÍÈçÏÂ:\n\n "); + for(i=0;i