学生综合测评系统

上传人:公**** 文档编号:431684518 上传时间:2023-09-18 格式:DOC 页数:41 大小:66.50KB
返回 下载 相关 举报
学生综合测评系统_第1页
第1页 / 共41页
学生综合测评系统_第2页
第2页 / 共41页
学生综合测评系统_第3页
第3页 / 共41页
学生综合测评系统_第4页
第4页 / 共41页
学生综合测评系统_第5页
第5页 / 共41页
点击查看更多>>
资源描述

《学生综合测评系统》由会员分享,可在线阅读,更多相关《学生综合测评系统(41页珍藏版)》请在金锄头文库上搜索。

1、word# include # include stdlib.h # include string.h#include struct student *Read();void save(struct student *head);void sinput(struct student *p);struct student *input();void paixu_num(struct student *head);struct student *insert();struct student *alter();struct student *del();void find_num(struct s

2、tudent *phead);void find_name(struct student *phead);void output();void min_student(struct student *phead);void max_student(struct student *phead);void ave_student(struct student *phead);void every_student(struct student *phead);void score_paixu(struct student *head);void help();void tj_menu(struct

3、student *head);void find_menu(struct student *head);void menu();struct student/定义学生信息结构数组,用于学生信息输入 char number13;char name13;char sex4;char adds15;char phone14; char 14;float chinese,math,english,txhp,pinde,teacher;int zcmc,ksmc;double ave,zc;struct student *next;#define Len sizeof(struct student)in

4、t len; /链表长度int a=0,b=0,c=0,d=0,e=0;/用来存放成绩各阶的人数char stu10;struct student *Read() /读取数据文件保存到链表中,返回指向此链表头指针struct student *head=NULL;struct student *p1, *p2;FILE *fp;cout请输入你要打开的文件(.dat)stu;if(fp=fopen(stu,rb+)=NULL)cout打开文件出错!endl;exit(0);while(!feof(fp) if( (p1=(struct student*)malloc(Len)=NULL )co

5、ut内存申请出错next=p1;p2=p1;fclose(fp);return head;void save(struct student *head)/数据存盘FILE *fp;struct student *p;p=head;cout请输入你要存进去的文件(.dat)stu;if(fp = fopen(stu, wb)=NULL)cout无法打开文件!endl;system(pause);menu();while(p) if(fwrite(p,Len,1,fp)!=1)cout写入数据出错next;cout数据存入成功!请按任意键继续!endl;getchar();fclose(fp);/

6、单次输入void sinput(struct student *p)cout请输入学号:p-number;cout请输入某某: p-name;cout请输入性别: p-sex;cout请输入家庭住址: p-adds;cout请输入联系: p-phone;cout请输入 : p- ;cout请输入语文成绩:p-chinese;if(p-chinese100|p-chinese0)cout成绩输入不符合规定,请重新输入:p-chinese;cout请输入数学成绩:p-math;if(p-math100|p-math0)cout成绩输入不符合规定,请重新输入:p-math;cout请输入英语成绩:p

7、-english;if(p-english100|p-english0)cout成绩输入不符合规定,请重新输入:p-english;cout请输入同学互评分:p-txhp;if(p-txhp100|p-txhp0)cout成绩输入不符合规定,请重新输入:p-txhp;cout请输入品德成绩:p-pinde;if(p-pinde100|p-pinde0)cout成绩输入不符合规定,请重新输入:p-pinde;cout请输入任课教师评分:p-teacher;if(p-teacher100|p-teacher0)cout成绩输入不符合规定,请重新输入:p-teacher;p-ave=(p-chine

8、se+p-math+p-english)/3.0;p-zc=(p-ave*0.6+p-txhp*0.1+p-pinde*0.2+p-teacher*0.1);coutendl;coutendl;cout你刚输入的信息为:endl;couttt学号:numberendl;couttt某某:nameendl;couttt性别:sexendl;couttt家庭住址:addsendl;couttt联系:phoneendl;couttt 号: endl;couttt语文成绩:chineseendl;couttt数学成绩:mathendl;couttt英语成绩:englishendl;couttt品德成绩

9、:pindeendl;couttt教师评分:teacherendl;coutendl;return;/学生成绩录入函数struct student *input()struct student *head=NULL,*p1,*p2;/输入p1,p2链表最后节点char ch=y;len=1; p2=p1=(struct student *)malloc(sizeof(struct student);cout请输入第len个学生的信息:endl;sinput(p1);coutendl;cout按n退出或按任意键继续ch;while(1)if(len=1)/作为头结点 head=p1;else p

10、2-next=p1;p2=p1;if(ch=N|ch=n)break;p1=(struct student *)malloc(sizeof(struct student);system(cls);len+;cout请输入第len个学生的信息:endl;sinput(p1);coutendl;cout按n退出或按任意键继续ch;p2-next=NULL;paixu_num(head);cout输入学生信息完成!请按任意键返回主菜单!endl;getchar();return head;/学号排序void paixu_num(struct student *head) struct student

11、 t,*r,*p,*q;/t交换p、q,r头结点 r=head; if(r=NULL) cout学生信息不存在,请先输入学生信息!next;while(q) if(strcmp(q-number,p-number)0) /qnumber);strcpy(t.name,q-name); strcpy(t.sex,q-sex); strcpy(t.adds,q-adds); strcpy(t.phone,q-phone); strcpy(t. ,q- ); t.chinese=q-chinese; t.math=q-math; t.english=q-english; t.txhp=q-txhp; t.pinde=q-pinde; t.teacher=q-teacher;strcpy(q-number,p-number);strcpy(q-name,p-name); strcpy(q-sex,p-

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 建筑/环境 > 施工组织

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号