如果您无法下载资料,请参考说明:
1、部分资料下载需要金币,请确保您的账户上有足够的金币
2、已购买过的文档,再次下载不重复扣费
3、资料包下载后请先用软件解压,在使用对应软件打开
代码:#include<stdio.h>#include<stdlib.h>typedefstructLnode{charnum[12];charname[7];doublechinese;doublemath;doubleEnglish;doubleaverage;structLnode*next;}*Linklist;voidCreat(Linklist&L,intn){inti=1;Linklistp,q;L=(Linklist)malloc(sizeof(Lnode));L->next=NULL;p=L;while(i<=n){q=(Linklist)malloc(sizeof(Lnode));scanf("%s%s%lf%lf%lf",q->num,q->name,&q->chinese,&q->math,&q->English);q->average=(q->chinese+q->math+q->English)/3.0;i++;p->next=q;p=q;}p->next=NULL;}voidOutput(Linklist&L,intm){Linklistp,q,r;p=q=L;while(p->next){if(p->next->average>q->average){q=p->next;r=p;p=q;}else{p=p->next;}}printf("%s%s%.2f%.2f%.2f%.2f",q->num,q->name,q->chinese,q->math,q->English,q->average);r->next=q->next;free(q);}intmain(){intn,i=1;LinklistL;scanf("%d",&n);Creat(L,n);while(i<=n){Output(L,n);printf("%d\n",i);i++;}return0;}