学生信息管理系统C语言代码.doc

学生信息管理系统C语言代码.doc

ID:56980101

大小:32.50 KB

页数:8页

时间:2020-07-30

学生信息管理系统C语言代码.doc_第1页
学生信息管理系统C语言代码.doc_第2页
学生信息管理系统C语言代码.doc_第3页
学生信息管理系统C语言代码.doc_第4页
学生信息管理系统C语言代码.doc_第5页
资源描述:

《学生信息管理系统C语言代码.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、#include#include#includestructshengri{intyear;intmonth;intday;};structstudent{charname[40];charsno[20];charsid[20];structshengribirth;intaddress[200];};structstudent*stu=NULL;intcurrent=0;inttotal=0;voidinsert(){if(stu==NULL)stu=(structstudent*)malloc(total*siz

2、eof(structstudent));if(current>=total){printf("对不起,由于人数已满,不能添加新学生信息");return;}printf("请输入学生姓名:");scanf("%s",stu[current].name);printf("请输入学生学号:");scanf("%s",stu[current].sno);printf("请输入学生身份证号码:");scanf("%s",stu[current].sid);printf("请输入学生出生日期格式(年-月-日):");scanf("%d-%d-%d",&stu[current].b

3、irth.year,&stu[current].birth.month,&stu[current].birth.day);printf("请输入学生家庭地址:");scanf("%s",stu[current].address);current++;return;}voidquery(){charname[40];charxuehao[40];inti,item,flag;printf("");printf("1.按学号查询");printf("2.按姓名查询");printf("3.退出本菜单");printf("");while(1){printf(

4、"");printf("请选择子菜单编号:");scanf("%d",&item);flag=0;switch(item){case1:printf("请输入要查询的学生的学号:");scanf("%s",xuehao);for(i=0;i

5、("出生日期:%d-%d-%d",stu[i].birth.year,stu[i].birth.month,stu[i].birth.day);printf("家庭地址:%s",stu[i].address);return;}if(flag==0)printf("");printf("警告:!!!!!!!学号为%s的学生不存在!!!!!!",xuehao);break;break;case2:printf("请输入要查询的学生的姓名:");scanf("%s",name);for(i=0;i

6、ame)==0){flag=1;printf("学生信息如下");printf("姓名:%s",stu[i].name);printf("学号:%s",stu[i].sno);printf("身份证号:%s",stu[i].sid);printf("出生日期:%d-%d-%d",stu[i].birth.year,stu[i].birth.month,stu[i].birth.day);printf("家庭地址:%s",stu[i].address);return;}if(flag==0)printf("");printf("警告:!!!!!!!

7、姓名为%s学生不存在!!!!!!",name);break;case3:return;default:printf("!!!!!!非法输入,请在1-3之间选择!!!!!!!");}}}voidupdate(){charname[40];inti;printf("请输入要修改的学生姓名:");scanf("%s",name);for(i=0;i

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

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

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