资源预览内容
第1页 / 共3页
第2页 / 共3页
第3页 / 共3页
亲,该文档总共3页全部预览完了,如果喜欢就下载吧!
资源描述
利用顺序表实现学生信息管理/ Exec2.cpp : Defines the entry point for the con sole applicati on./#i nclude stdafx.h#in clude #in clude struct Stude nt(char id10;char n ame10;char sex10;char grade10;char tel20;int age;class SeqListpublic :Stude nt data200;int len gth;SeqList()le ngth=O; bool lsListEmpty()retur n len gth=0;void ListDelete(char ID)for(i nt0;ile ngth;i+)/如果当前数据的id等于用户输入要删除数据的id,进行删除操作。if(strcmp(datai.id,ID)=O)后面所有数据向前挪动一个位置for(i nt j=i+1;jle ngth;j+)dataj-1=dataj;len gth=le ngth-1;return; coutID=ID=0;i_)datai+1=datai;data0=x;len gth+;void ShowAII()for(i nt0;ile ngth;i+)coutID=datai.idtNAME=datai.nametSEX=datai.sextGRADE=datai.gradetTEL=datai.teltAGE=datai.age x;switch(x)case 1:GIS2010.ShowAII();break;case 2:Stude nt n ewStude nt;coutID=n ewStude nt.id;coutNAME=e ndl;cinn ewStude nt. name;coutSEX=e ndl;cinn ewStude nt.sex; coutGRADE=e ndl; cinn ewStude nt.grade; coutTEL=e ndl;cinn ewStude nt.tel; coutAGE=e ndl;cinn ewStude nt.age;GIS2010. ListI nsert( newStude nt); break;case 3:char dellD10;cout请输入想要删除数据项的ID号码dellD;GIS2010 .L istDelete(delID); break;case 0:break;return 0;
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号