您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 管理学资料 > 高考成绩管理系统(C语言)
#includemalloc.h#includestdio.h#includestdlib.h#includestring.h#includeprocess.h#defineLENsizeof(structscorenode)#defineDEBUGstructscorenode{intnumber;charname[10];floatyuwen;floatyingyu;floatshuxue;floatzonghe;floatzongfen;structscorenode*next;};typedefstructscorenodescore;intn,k;score*creat(void);score*load(score*head);score*add(score*head,score*stu);score*search(score*head);score*del(score*head);voidprint(score*head);score*taxis(score*head);voidsave(score*p1);voidswap(score*a,score*b);voidPasswordTest(void);score*sum(score*head);voidstatistics(score*head);score*sum(score*head){score*p;p=head;while(p){p-zongfen=p-yuwen+p-shuxue+p-yingyu+p-zonghe;p=p-next;}return(head);}voidswap(score*a,score*b){intk;floatfen;chart[10];k=a-number;a-number=b-number;b-number=k;strcpy(t,a-name);strcpy(a-name,b-name);strcpy(b-name,t);fen=a-yuwen;a-yuwen=b-yuwen;b-yuwen=fen;fen=a-yingyu;a-yingyu=b-yingyu;b-yingyu=fen;fen=a-shuxue;a-shuxue=b-shuxue;b-shuxue=fen;fen=a-zonghe;a-zonghe=b-zonghe;b-zonghe=fen;fen=a-zongfen;a-zongfen=b-zongfen;b-zongfen=fen;}voidPasswordTest(void){charpw[8]=abcdef;charx[8];inti;charm;for(i=0;i3;i++){printf(ÇëÊäÈëÃÜÂ룺\n);scanf(%s,x);printf(ÕýÔÚÑéÖ¤ÃÜÂë¡£¡£¡£\n);if(strcmp(x,pw)==0){printf(ÃÜÂëÕýÈ·\n);break;}elseprintf(ÃÜÂë´íÎó£¡Äú»¹ÓÐ%d´Î»ú»á£¡\n\n,2-i);}if(i==3)exit(0);for(i=0;i80;i++)printf(*);printf(Çë°´Enter¼ü½øÈë\n);fflush(stdin);scanf(%c,&m);system(cls);printf(»¶Ó½øÈëϵͳ\n);}score*creat(void){score*head;score*p1,*p2,*p3,*max;inti,j;n=0;p1=p2=p3=(score*)malloc(LEN);head=p3;printf(ÇëÊäÈëѧÉú×ÊÁÏ£¬Êä0Í˳ö!\n);repeat1:printf(ÇëÊäÈëѧÉúѧºÅ(ѧºÅÓ¦´óÓÚ0)£º);scanf(%d,&p1-number);while(p1-number0){getchar();printf(ÊäÈë´íÎó£¬ÇëÖØÐÂÊäÈëѧÉúѧºÅ:);scanf(%d,&p1-number);}if(p1-number==0)gotoend;else{p3=head;if(n0){for(i=0;in;i++){if(p1-number!=p3-number)p3=p3-next;else{printf(ѧºÅÖظ´,ÇëÖØÊä!\n);gotorepeat1;}}}}printf(ÇëÊäÈëѧÉúÐÕÃû£º);scanf(%s,&p1-name);printf(ÇëÊäÈëÓïÎijɼ¨(0~150)£º);scanf(%f,&p1-yuwen);while(p1-yuwen0||p1-yuwen150){getchar();printf(ÊäÈë´íÎó£¬ÇëÖØÐÂÊäÈëÓïÎijɼ¨);scanf(%f,&p1-yuwen);}printf(ÇëÊäÈëÓ¢Óï³É¼¨(0~150)£º);scanf(%f,&p1-yingyu);while(p1-yingyu0||p1-yingyu150){getchar();printf(ÊäÈë´íÎó£¬ÇëÖØÐÂÊäÈëÓ¢Óï³É¼¨);scanf(%f,&p1-yingyu);}printf(ÇëÊäÈëÊýѧ³É¼¨(0~150)£º);scanf(%f,&p1-shuxue);while(p1-shuxue0||p1-shuxue150){getchar();printf(ÊäÈë´íÎó£¬ÇëÖØÐÂÊäÈëÊýѧ³É¼¨);scanf(%f,&p1-shuxue);}printf(ÇëÊäÈë×ۺϿƳɼ¨(0~300)£º);scanf(%f,&p1-zonghe);while(p1-zonghe0||p1-zonghe300){getchar();printf(ÊäÈë´íÎó£¬ÇëÖØÐÂÊäÈë×ۺϿƳɼ¨);scanf(%f,&p1-zonghe);}head=NULL;while(p1-number!=0){n=n+1;if(n==1)head=p1;elsep2-next=p1;p2=p1;p1=(score*)malloc(LEN);printf(ÇëÊäÈëѧÉú×ÊÁÏ£¬Êä0Í˳ö!\n);repeat2:printf(ÇëÊäÈëѧÉúѧºÅ(ѧºÅÓ¦´óÓÚ0)£º);scanf(%d,&p1-number);while(p1-number0){getchar();printf(ÊäÈë´íÎó,ÇëÖØÐÂÊäÈëѧÉúѧºÅ:);scanf(%d,&p1-number);}if(p1-number==0)gotoend;else{p3=head;if(n0){for(i=0;in;i++){if(p1-number!=p3-number)p3=p3-next;else{printf(ѧºÅÖظ´,ÇëÖØÊä!\n);gotorepeat2;}}}}printf(ÇëÊäÈëѧÉúÐÕÃû£º);scanf(%s,&p1-name);printf(ÇëÊäÈëÓïÎijɼ¨(0~150)£º);scanf(%f,&p1-yuwen);while(p1-yuwen0||p1-yuwen150){getchar();printf(ÊäÈë´íÎó£¬ÇëÖØÐÂÊäÈëÓïÎijɼ¨);scanf(%f,&p1-yuwen);}printf(ÇëÊäÈëÓ¢Óï³É¼¨(0~150)£º);scanf(%f,&p1-yingyu);while(p1-yingyu0||p1-yingyu150){getchar();printf(ÊäÈë´íÎó£¬ÇëÖØÐÂÊäÈëÓ¢Óï³É¼¨);scanf(%f,&p1-yingyu);}printf(ÇëÊäÈëÊýѧ³É¼¨(0~150)£º);scanf(%f,&p1-shuxue);while(p1-shuxue0||p1-shuxue150){getchar();printf(ÊäÈë´íÎó£¬ÇëÖØÐÂÊäÈëÊýѧ³É¼¨);scanf(%f,&p1-shuxue);}printf(ÇëÊäÈë×ۺϿƳɼ¨(0~300)£º);scanf(%f,&p1-zonghe);while(p1-zonghe0||p1-zonghe300){getchar();printf(ÊäÈë´íÎó£¬ÇëÖØÐÂÊäÈë×ۺϿƳɼ¨);scanf(%f,&p1-zonghe);}}end:p1=head;p3=p1;for(i=1;in;i++){for(j=i+1;j=n;j++){max=p1;p1=p1-next;if(max-numberp1-number){swap(max,p1);}}max=head;p1=head;}p2-next=NULL;printf(ÊäÈëµÄѧÉúÊýΪ:%d¸ö!\n,n);return(head);}score*load(score*head){score*p1,*p2;intm=0;charfilepn[10];FILE*fp;printf(ÇëÊäÈëÎļþ·¾¶¼°ÎļþÃû:);scanf(%s,filepn);if((fp=fopen(filepn,r+))==NULL){printf(²»ÄÜ´ò¿ªÎļþ!\n);return0;}fscanf(fp,¸ß¿¼³É¼¨¹ÜÀíϵͳ\n);fscanf(fp,-----------------------------------------\n);fscanf(fp,|ѧºÅ\t|ÐÕÃû\t|ÓïÎÄ\t|Ó¢Óï\t|Êýѧ\t|×ۺϿÆ\t|×Ü·Ö\t|\n);fscanf(fp,-----------------------------------------\n);printf(¸ß¿¼³É¼¨¹ÜÀíϵͳ\n);printf(-----------------------------------------\n);printf(|ѧºÅ\t|ÐÕÃû\t|ÓïÎÄ\t|Ó¢Óï\t|Êýѧ\t|×ۺϿÆ\t|×Ü·Ö\t|\n);printf(-----------------------------------------\n);m=m+1;if(m==1){p1=(score*)malloc(LEN);fscanf(fp,%d%s%f%f%f%f%f,&p1-number,p1-name,&p1-yuwen,&p1-yingyu,&p1-shuxue,&p1-zonghe,&p1-zongfen);printf(|%d\t|%s\t|%.1f\t|%.1f\t|%.1f\t|%.1f\t|%.1f\t|\n,p1-number,p1-name,p1-yuwen,p1-yingyu,p1-shuxue,p1-zonghe,p1-zongfen);head=NULL;do{n=n+1;if(n==1)head=p1;elsep2-next=p1;p2=p1;p1=(score*)malloc(LEN);fscanf(fp,%d%s%f%f%f%f%f\n,&p1-number,p1-name,&p1-yuwen,&p1-yingyu,&p1-shuxue,&p1-zonghe,&p1-zongfen);printf(|%d\t|%s\t|%.1f\t|%.1f\t|%.1f\t|%.1f\t|%.
本文标题:高考成绩管理系统(C语言)
链接地址:https://www.777doc.com/doc-4683888 .html