链表版成绩管理系统_第1页
链表版成绩管理系统_第2页
链表版成绩管理系统_第3页
链表版成绩管理系统_第4页
链表版成绩管理系统_第5页
已阅读5页,还剩20页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

这个管理系统还有一些东西可以等大家完善 并且简单易懂 include include include include include include include typedef struct student int num char name 10 char sex 6 float china float muth float english float sum float average struct student next stu void Chakanmenu void passwordCheck 密码系统 struct student startCheck 开始 void gotoxy int x int y x 为列坐标 y 为行坐标 void menu 主菜单 struct student insert 创建链表 并输入数据 struct student Charu stu head 向链表中插入数据 struct student Delete stu head 删除链表中数据 struct student Xuigai stu head 修改链表中数据 struct student readfile 将文件中信息读取到链表中 void savelist stu phead 将处理后的链表保存到文件 void save stu phead 将链表中数据保存到文件中 void jiaohuan stu p stu q int n float c m e s a char name 10 sex 6 n q num q num p num p num n c q china q china p china p china c m p muth p muth q muth q muth m e q english q english p english p english e s q sum q sum p sum p sum s a q average q average p average p average a strcpy name q name strcpy q name p name strcpy p name name strcpy sex q sex strcpy q sex p sex strcpy p sex sex struct student Xuepaixu stu head int count 1 i j stu p q p q head while p next NULL count p p next for i 1 i count i for j 0 jnumnext num jiaohuan q q next q q next q head return head struct student Zongpaixu stu head int count 1 i j stu p q p q head while p next NULL count p p next for i 1 i count i for j 0 jsumnext sum jiaohuan q q next q q next q head return head struct student Pingpaixu stu head int count 1 i j stu p q p q head while p next NULL count p p next for i 1 i count i for j 0 javeragenext average jiaohuan q q next q q next q head return head void savelist stu phead FILE fp fp fopen data dat w while phead NULL fprintf fp n fprintf fp d s s 2f 2f 2f 2f 2f phead num phead name phead sex phead china phead muth phead english phead sum phead average phead phead next fclose fp struct student readfile stu phead NULL p FILE fp if fp fopen data dat rb NULL fclose fp return phead else p struct student malloc sizeof struct student fscanf fp d s s f f f f f phead p while fgetc fp EOF p next struct student malloc sizeof struct student p p next fscanf fp d s s f f f f f if 0 p muth p muth 100 break p next NULL fclose fp return phead void Shuchu stu head system CLS if head NULL printf t t t 你还没有录入学生信息 即将返回主菜单 Sleep 2000 menu else int i count 0 printf n n printf n 学号 姓 名 性别 语 文 数 学 英 语 平均分 总 分 n while head NULL printf 5d 6s 2s 5 1f 5 1f 5 1f 5 1f 5 1f n head num head name head sex head china head muth head english head average head sum head head next count printf n printf 在线人数 d n count printf 返回主菜单按任意键 scanf d void passwordCheck char password 20 inputword 20 int i 0 j 0 char c 0 FILE fp fopen password dat rb system title 学生成绩统计系统 密码输入 将标题栏命名为 学生成绩统计系统 fread password 20 1 fp for i 0 i 3 i j 0 printf n n n t t 你还有 d 次机会输入正确密码 3 i printf n n n n t t t n printf t t t n printf t t t n gotoxy 26 8 while c getch 13 putchar putchar b j else if isprint c isprint 为检测 C 是否为可打印的函数 putchar inputword j c j inputword j 0 if strcmp inputword password 0 return else system CLS printf t t t 密码输入错误 if 3 i system CLS printf n n n t t 你已浪费所有机会 程序即将退出 Sleep 2000 exit 0 fclose fp system CLS struct student startCheck void FILE fp1 char password 20 666666 int i if fp1 fopen password dat rb NULL 若密码文件不存在 新建密码文件 fp1 fopen password dat wb fwrite password 20 1 fp1 fclose fp1 printf 密码初始化完成 默认密码为 666666 passwordCheck else passwordCheck 读条 system CLS system title 学生成绩统计系统 载入中 将标题栏命名为 学生成绩统计系统 printf n n t t t 欢迎进入本系统 正在载入 printf n n n n t t t n printf t t t n printf t t t n gotoxy 26 7 for i 0 i num phead name phead sex phead china phead muth phead english phead sum phead average phead phead next fclose fp else fp fopen data dat a while phead NULL fprintf fp n fprintf fp d s s 2f 2f 2f 2f 2f phead num phead name phead sex phead china phead muth phead english phead sum phead average phead phead next fclose fp struct student insert system CLS stu p q head int count int a head p q NULL printf 请按照规定的格式输入 性别和名字请用中文输入 各科成绩在 0 100 之间 n p struct student malloc sizeof struct student head p printf 请输入学号 scanf d while 1 if p numnumprintf 输入错误 请重新输入 n printf 请输入学号 scanf d else break printf 请输入中文名字 scanf s p name while 1 if p name a printf 请输入中文名字 scanf s p name else break printf 请输入中文性别 scanf s p sex printf 请输入语文成绩 scanf f while 1 if p china 0 printf 请输入数学成绩 scanf f while 1 if p muth 0 printf 请输入外语成绩 scanf f while 1 if p english 0 p sum p china p muth p english p average p sum 3 p next NULL printf n printf n printf 你是否继续输入 若继续请输入 1 退出请按任意数字 scanf d while a 1 p next struct student malloc sizeof struct student p p next printf 请输入学号 scanf d while 1 if p numnumprintf 输入错误 请重新输入 n printf 请输入学号 scanf d else break printf 请输入中文名字 scanf s p name while 1 if p name a printf 请输入中文名字 scanf s p name else break printf 请输入中文性别 scanf s p sex printf 请输入语文成绩 scanf f while 1 if p china 0 printf 请输入数学成绩 scanf f while 1 if p muth 0 printf 请输入外语成绩 scanf f while 1 if p english 0 p sum p china p muth p english p average p sum 3 p next NULL printf n printf n printf 你是否继续输入 若继续请输入 1 退出请按任意数字 n scanf f return head struct student Charu stu head system CLS int i n a char cname 10 stu p q if head NULL printf t t t 你还没有录入数据 即将返回主菜单 Sleep 2000 menu return head else q head p struct student malloc sizeof struct student printf 请输入想插入的学号 scanf d while 1 if p numnumprintf 输入错误 请重新输入 n printf 请输入学号 scanf d else break printf 请输入中文名字 scanf s p name while 1 if p name a printf 请输入中文名字 scanf s p name else break printf 请输入中文性别 scanf s p sex printf 请输入语文成绩 scanf f while 1 if p china 0 printf 请输入数学成绩 scanf f while 1 if p muth 0 printf 请输入外语成绩 scanf f while 1 if p english 0 p sum p china p muth p english p average p sum 3 p next NULL printf 1 按学号插入 n printf 2 按名字插入 n printf 请选择插入方式 n scanf d switch i case 1 printf 请输入你想插入的位置的学号 学号之后 scanf d while 1 if p numnumprintf 输入错误 请重新输入 n printf 请输入学号 scanf d else break while q num n if q next NULL p next q next q next p return head else printf 你要插入的位置不存在 return head break case 2 printf 请输入你想插入位置的名字 名字之后 scanf s cname while 1 if p name a printf 请输入中文名字 scanf s p name else break a strcmp q name cname while a 0 a strcmp q name cname if q next NULL p next q next q next p return head else printf 你想要插入的位置不存在 return head break default printf 输入错误 return head struct student Delete stu head system CLS stu p q p head int i n a char Sname 10 if head NULL printf t t t 你还没有录入学生信息 即将返回主页面 Sleep 2000 return head else printf 1 按名字删除 n printf 2 按学号删除 n printf 请选择 scanf d switch i case 1 printf 请输入想删除学生名字 scanf s Sname while 1 if p name a printf 请输入中文名字 scanf s p name else break a strcmp p name Sname if a 0 head head next free p return head else q head next a strcmp p name Sname while a 0 p p next a strcmp q name Sname if q next NULL p next q next free q return head else printf 你想删除的同学不存在 return head case 2 printf 请输入想删除学生的学号 scanf d while 1 if p numnumprintf 输入错误 请重新输入 n printf 请输入学号 scanf d else break if p num n head head next return head else q head next while q num n q q next if q next NULL p next q next free q return head else printf 你想删除的学生不存在 return head default printf 输入错误 return head struct student Xuigai stu head system CLS stu p char Xname 10 int i n a if head NULL printf t t t 你还没有录入学生信息 即将返回主菜单 Sleep 2000 menu else printf 1 按名字查找修改 n printf 2 按学号查找修改 n printf 请选择 scanf d p head switch i case 1 printf 请输入你想修改同学姓名 scanf s Xname while 1 if p name a printf 请输入中文名字 scanf s p name else break a strcmp p name Xname while a 0 a strcmp p name Xname if p next NULL printf 请重新输入该同学的成绩 n printf 语文 scanf f while 1 if p china 0 printf 请输入数学成绩 scanf f while 1 if p muth 0 printf 请输入外语成绩 scanf f while 1 if p english 0 p sum p china p english p muth p average p sum 3 printf 修改成功 return head else printf 你想修改的同学不存在 n return head case 2 printf 请输入你想修改同学的学号 n scanf d while 1 if p nu

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论