源代码学生信息管理系统

源代码学生信息管理系统

ID:22886579

大小:75.51 KB

页数:10页

时间:2018-11-01

源代码学生信息管理系统_第1页
源代码学生信息管理系统_第2页
源代码学生信息管理系统_第3页
源代码学生信息管理系统_第4页
源代码学生信息管理系统_第5页
资源描述:

《源代码学生信息管理系统》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、注意:必须在你的电脑里建一个文档来存储学生信息,我是再d盘建了一个stu.txt的文档,所以你只要在d盘建一个一样的就可以了。如果你要改变存储路径,就必须把程序中的d:\stu.txt全都改了#include#include#include#includeusingnamespacestd;voidmenu(){system("cls");cout<<"**********************************

2、********"<

3、*********"<

4、pedefstruct{longintnum;//学号charname[20];//姓名charsex[4];//性别charadd[20];//住址charnative[40];//籍贯intage;//年龄}data;typedefstructstu{datax;structstu*next;}node,*pnode;//链表结点的定义classstudent{private:node*head;public:student();pnodegethead();//获取头结点voidinser

5、t(datax);//插入voidoutput();//打印voiddel(char*name);//删除voidchange(char*name);//修改voidfind(char*str);//查找};student::student(){head=(node*)new(node);head->next=NULL;}voidstudent::insert(dataa){node*p;p=(node*)new(node);p->x=a;p->next=head->next;head->nex

6、t=p;}voidstudent::output(){node*p;inti=0,t,tempt;longinta[100];p=head->next;if(p==NULL)cout<<"没有学生信息!!"<x.num;p

7、=p->next;}t=i;for(intn=0;n<=t;n++)//按学号大小排序for(intj=n+1;j<=t;j++){if(a[n]>a[j]){tempt=a[n];a[n]=a[j];a[j]=tempt;}}p=head->next;if(p!=NULL){for(i=0;i<=t;i++)//打印排序后的信息{while(p!=NULL){if(p->x.num==a[i])cout<x.name<<'t'<x.num<<'t'<

8、etw(5)<x.add<<'t'<x.native<<'t'<x.sex<<'t'<x.age<next;}p=head->next;}}p=head->next;}}}voidstudent::del(char*name){node*p,*per;intflag=1;p=head->next;per=head;if(p==NULL)cout<<"空链表,不能删除!!"<

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。