ImageVerifierCode 换一换
格式:DOCX , 页数:15 ,大小:60.07KB ,
资源ID:5040180      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/5040180.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(C语言课设学生信息管理系统.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

C语言课设学生信息管理系统.docx

1、C语言课设学生信息管理系统全局变量struct studchar name20;long num;int age;char sex;int score3;char tele12;struct stud *next;子程序1.creat()函数功能:创建链表,提示输入学生信息,储存到链表中,录入完成后输入y继续,输入n停止,返回主菜单2.display()函数功能:显示当前已经存入链表的信息3.dele()函数功能:删除链表中学生信息,可按姓名或学号删除4.add()函数功能:按学号插入学生信息5.modify()函数功能:修改链表中学生信息6.search()函数功能:查找学生信息,可按学号或

2、姓名查找7.sort()函数功能:对信息进行排序,可实现分别对三门成绩排序8.save()函数功能:将链表中的数据保存到指定文件9.load()函数功能:将指定文件中已有的数据读入链表源程序#include#include#include#includestruct studchar name20;long num;int age;char sex;int score3;char tele12;struct stud *next;main()struct stud *head;struct stud *creat(void);void display(struct stud *head);st

3、ruct stud *dele(struct stud *head);struct stud *add(struct stud *head);struct stud *modify(struct stud *head);void search(struct stud *head);void save(struct stud *head);struct stud *sort(struct stud *head);void save(struct stud *head);struct stud *load();char ch;head=NULL;for(;) clrscr(); /*清屏函数*/p

4、rintf(“nnttWelcome to student informationmanagement system”); printf(“nnt*”); printf(“nttt 1: Enter the information”); printf(“nttt 2: List the information”); printf(“nttt 3: Delete the information”); printf(“nttt 4: Add the information”); printf(“nttt 5: Modify the information”); printf(“nttt 6: Se

5、arch the information”);printf(“nttt 7: Sort the information”); printf(“nttt 8: Save the information”); printf(“nttt 9: Load the information”); printf(“nttt 0: Exit “); printf(“nttt Enter your choice:”); fflush(stdin); ch=getchar();getchar();switch(ch) case 1: head=creat();break;case 2:display(head);

6、system(“pause”); break;case 3:head=dele(head);system(“pause”);break;case 4:head=add(head);system(“pause”);break;case 5:head=modify(head);system(“pause”);break;case 6:search(head);system(“pause”);break;case 7:head=sort(head);system(“pause”);break;case 8:save(head);system(“pause”);break;case 9:head=lo

7、ad();break;case 0:return;break;default : clrscr();printf(“nt Error!Please check your inputnn”);system(“pause”); struct stud *creat(void) /*链表的创建*/struct stud *head,*p1;char ch;clrscr();head=NULL;p1=(struct stud *)malloc(sizeof(struct stud);printf(“t enter name:”); gets(p1-name); printf(“t enter numb

8、er:”); scanf(“%ld”,&p1-num); printf(“t enter age:”); scanf(“%d”,&p1-age); printf(“t enter sex:”); fflush(stdin); scanf(“%c”,&p1-sex); printf(“t enter Math score:”); scanf(“%d”,&p1-score0); printf(“t enter English score:”); scanf(“%d”,&p1-score1); printf(“t enter C score:”); scanf(“%d”,&p1-score2); p

9、rintf(“t enter telephone number:”); fflush(stdin); gets(p1-tele); head=p1;p1-next=NULL; do printf(“ntDO YOU WANT TO CONTINUE? Y or N?”); printf(“ntEnter your choise:”); fflush(stdin); ch=getchar(); clrscr(); if(ch=y|ch=Y) head=add(head); else if(ch!=N&ch!=n) printf(“ntError !Please check your input”

10、);ch=y;while(ch=y|ch=Y);return(head);struct stud *dele(struct stud *head)/*链表的删除*/struct stud *p1,*p2;int choose;long delnum;char name20;clrscr();printf(“nttChoose the way you want”);printf(“nt 1: According to namen “);printf(“nt 2: According to numn”);printf(“nt Enter your choice:”);scanf(“%d”,&cho

11、ose);fflush(stdin);if(choose=1)printf(“nt Enter the name:”);gets(name); if(head=NULL)printf(“tnNo information !n”);return(head); p1=head; while(strcmp(name,p1-name)!=0&p1-next!=NULL)p2=p1;p1=p1-next;if(strcmp(name,p1-name)=0)if(p1=head)head=p1-next;else p2-next=p1-next;printf(“t Delete Successed !nn

12、”);else printf(“t Not been find!nn”);return(head);else if(choose=2)printf(“ntEnter the number:”);scanf(“%ld”,&delnum);if(head=NULL)printf(“nNo information !n”);return(head); p1=head; while(delnum!=p1-num&p1-next!=NULL)p2=p1;p1=p1-next;if(delnum=p1-num)if(p1=head)head=p1-next;else p2-next=p1-next;pri

13、ntf(“t Delete Successed !nn”);else printf(“t Not been find!n”);return(head);else printf(“nt Error!Please check your inputnn”);return(head);void display(struct stud *head)struct stud *p;p=head;clrscr();if(head=NULL)printf(“nt No informationnn”);else printf(“nametnumbertagetsextMathtEnglishtCttelephon

14、e numbern”);doprintf(“%st%ldt%dt%ct%dt%dt%dt%sn”,p-name,p-num,p-age,p-sex,p-score0,p-score1,p-score2,p-tele);p=p-next;while(p!=NULL); struct stud *add(struct stud *head)/*链表的插入*/struct stud *p1,*p2,*p0;p0=(struct stud *)malloc(sizeof(struct stud);clrscr();printf(“ntt Input the information:”);printf(

15、“ntt name:”);fflush(stdin);gets(p0-name);printf(“tt number:”);scanf(“%ld”,&p0-num);printf(“tt age:”);scanf(“%d”,&p0-age);printf(“tt sex:”);fflush(stdin);scanf(“%c”,&p0-sex);printf(“tt Math score:”);scanf(“%d”,&p0-score0);printf(“tt English score:”);scanf(“%d”,&p0-score1);printf(“tt C score:”);scanf(

16、“%d”,&p0-score2);printf(“tt telephone number:”);fflush(stdin);gets(p0-tele); p1=head;if(head=NULL)head=p0;p0-next=NULL;elsewhile(p0-nump1-num)p2=p1,p1=p1-next;if(p0-numnum)if(head=p1)head=p0;else p2-next=p0;p0-next=p1;elsep1-next=p0;p0-next=NULL;return(head); struct stud *modify(struct stud *head)/*

17、链表的修改*/struct stud *p1,*p2,*p0;clrscr();printf(“ntInput the students name:”);p0=(struct stud *)malloc(sizeof(struct stud);fflush(stdin);gets(p0-name);if(head=NULL)printf(“nNo information !nn”);return(head); p1=head; while(strcmp(p0-name,p1-name)!=0&p1-next!=NULL)p2=p1;p1=p1-next;if(strcmp(p0-name,p1

18、-name)=0)printf(“nametnumbertagetsextMathtEnglishtCttelephone numbern”);printf(“%st%ldt%dt%ct%dt%dt%dt%sn”,p1-name,p1-num,p1-age,p1-sex,p1-score0,p1-score1,p1-score2,p1-tele);if(p1=head)head=p1-next; else p2-next=p1-next; printf(“tNew information: number:”); scanf(“%ld”,&p0-num); printf(“ttt age:”);

19、 scanf(“%d”,&p0-age); printf(“ttt sex:”); fflush(stdin); scanf(“%c”,&p0-sex); printf(“ttt Math score:”); scanf(“%d”,&p1-score0); printf(“ttt English score:”); scanf(“%d”,&p1-score1); printf(“ttt C score:”); scanf(“%d”,&p1-score2); printf(“ttt telephone number:”); fflush(stdin); gets(p0-tele); p1=hea

20、d; if(head=NULL)head=p0;p0-next=NULL;elsewhile(p0-nump1-num)p2=p1;p1=p1-next;if(p0-numnum)if(head=p1)head=p0;else p2-next=p0;p0-next=p1;elsep1-next=p0;p0-next=NULL;printf(“Modify Successed !nn”);else printf(“Not been find!nn”);return(head);void search(struct stud *head)/*查询链表 */struct stud *p;int ch

21、oose;long num;char name20;clrscr();printf(“nttChoose the way you want”);printf(“nt 1: According to namen “);printf(“nt 2: According to numn”);printf(“nt Enter your choice:”);scanf(“%d”,&choose);fflush(stdin);if(choose=1)printf(“nt enter the name:”);gets(name);if(head=NULL)printf(“tnNo information !n

22、n”);elsep=head;while(strcmp(name,p-name)!=0&p-next!=NULL)p=p-next;if(strcmp(name,p-name)=0)printf(“nametnumbertagetsextMathtEnglishtCttelephone numbern”);printf(“%st%ldt%dt%ct%dt%dt%dt%sn”,p-name,p-num,p-age,p-sex,p-score0,p-score1,p-score2,p-tele);else printf(“ Not been find!nn”);else if(choose=2)p

23、rintf(“nt Enter the number:”);scanf(“%ld”,&num);if(head=NULL)printf(“nNo information!n”);elsep=head;while(num!=p-num&p-next!=NULL)p=p-next;if(num=p-num)printf(“nametnumbertagetsextMathtEnglishtCttelephone numbern”);printf(“%st%ldt%dt%ct%dt%dt%dt%sn”,p-name,p-num,p-age,p-sex,p-score0,p-score1,p-score

24、2,p-tele);else printf(“t Not been find!n”);else printf(“nt Error!Please check your inputnn”);struct stud *sort(struct stud *head)struct stud *first;struct stud *t;struct stud *p; struct stud *q;int ch;clrscr();printf(“nttChoose the way you want”);printf(“nt 1: According to Math:n”);printf(“nt 2: Acc

25、ording to Englishn”);printf(“nt 3: According to Cn”);printf(“nt Enter your choice:”);scanf(“%d”,&ch);first = head-next;head-next = NULL;while (first != NULL) for (t=first, q=head; (q!=NULL) & (q-scorech-1t-scorech-1); p=q, q=q-next);first = first-next; if (q = head) head = t;elsep-next = t;t-next =

26、q; printf(“nttSuccess !n”);return head;void save(struct stud *head) /*保存链表*/FILE *fp;struct stud *p;char filename20;printf(“nninput the filename: “);fflush(stdin);gets(filename);if(fp=fopen(filename,”w”)=NULL)printf(“Save file %s error ! Type it again.nn”,filename);exit(0);p=head;while(p!=NULL) fpri

27、ntf(fp,”%st”,p-name);fprintf(fp,”%ldt”,p-num);fprintf(fp,”%dt”,p-age);fprintf(fp,”%ct”,p-sex);fprintf(fp,”%dt”,p-score0);fprintf(fp,”%dt”,p-score1);fprintf(fp,”%dt”,p-score2);fprintf(fp,”%stn”,p-tele);p=p-next;printf(“nttSuccess !n”);fclose(fp);struct stud *load() /*链表的导入*/FILE *fp;char filename20;s

28、truct stud *head,*p1,*p2;printf(“nninput the filename: “);fflush(stdin);gets(filename);if(fp=fopen(filename,”r”)=NULL)printf(“Load file %s error ! Type it again.nn”,filename);exit(0);if(!feof(fp)head=(struct stud *) malloc(sizeof(struct stud);fscanf(fp,”%st”,&head-name);fscanf(fp,”%ldt”,&head-num);fscanf(fp,”%dt”,&head-age);fscanf(fp,”%ct”,&head-sex);fscanf(fp,”

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1