欢迎来到天天文库
浏览记录
ID:22886579
大小:75.51 KB
页数:10页
时间:2018-11-01
《源代码学生信息管理系统》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
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();//获取头结点voidinser5、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->nex6、t=p;}voidstudent::output(){node*p;inti=0,t,tempt;longinta[100];p=head->next;if(p==NULL)cout<<"没有学生信息!!"<x.num;p7、=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<<"空链表,不能删除!!"<
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();//获取头结点voidinser5、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->nex6、t=p;}voidstudent::output(){node*p;inti=0,t,tempt;longinta[100];p=head->next;if(p==NULL)cout<<"没有学生信息!!"<x.num;p7、=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<<"空链表,不能删除!!"<
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<<"空链表,不能删除!!"<
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<<"空链表,不能删除!!"<
此文档下载收益归作者所有