学生管理系统C语言编程Word格式文档下载.docx

上传人:b****1 文档编号:4831147 上传时间:2023-05-04 格式:DOCX 页数:44 大小:23.60KB
下载 相关 举报
学生管理系统C语言编程Word格式文档下载.docx_第1页
第1页 / 共44页
学生管理系统C语言编程Word格式文档下载.docx_第2页
第2页 / 共44页
学生管理系统C语言编程Word格式文档下载.docx_第3页
第3页 / 共44页
学生管理系统C语言编程Word格式文档下载.docx_第4页
第4页 / 共44页
学生管理系统C语言编程Word格式文档下载.docx_第5页
第5页 / 共44页
学生管理系统C语言编程Word格式文档下载.docx_第6页
第6页 / 共44页
学生管理系统C语言编程Word格式文档下载.docx_第7页
第7页 / 共44页
学生管理系统C语言编程Word格式文档下载.docx_第8页
第8页 / 共44页
学生管理系统C语言编程Word格式文档下载.docx_第9页
第9页 / 共44页
学生管理系统C语言编程Word格式文档下载.docx_第10页
第10页 / 共44页
学生管理系统C语言编程Word格式文档下载.docx_第11页
第11页 / 共44页
学生管理系统C语言编程Word格式文档下载.docx_第12页
第12页 / 共44页
学生管理系统C语言编程Word格式文档下载.docx_第13页
第13页 / 共44页
学生管理系统C语言编程Word格式文档下载.docx_第14页
第14页 / 共44页
学生管理系统C语言编程Word格式文档下载.docx_第15页
第15页 / 共44页
学生管理系统C语言编程Word格式文档下载.docx_第16页
第16页 / 共44页
学生管理系统C语言编程Word格式文档下载.docx_第17页
第17页 / 共44页
学生管理系统C语言编程Word格式文档下载.docx_第18页
第18页 / 共44页
学生管理系统C语言编程Word格式文档下载.docx_第19页
第19页 / 共44页
学生管理系统C语言编程Word格式文档下载.docx_第20页
第20页 / 共44页
亲,该文档总共44页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

学生管理系统C语言编程Word格式文档下载.docx

《学生管理系统C语言编程Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《学生管理系统C语言编程Word格式文档下载.docx(44页珍藏版)》请在冰点文库上搜索。

学生管理系统C语言编程Word格式文档下载.docx

structstuMark

longintstunumb;

charnameb[10];

floatchinese;

floatmath;

floatenglish;

floataverage;

structstuMark*nextb;

voidfileSaveMark(structstuMark*headb);

voidfindStudentMark(structstuMark*headb);

voidfindOneStuMark(structstuMark*headb);

voidfindAllStuMark(structstuMark*headb);

structstuMark*insertStudentMark(structstuMark*headb);

structstuMark*changeStudentMark(structstuMark*headb);

structstuMark*changeOneStuMark(structstuMark*q);

structstuMark*deleteStudentMark(structstuMark*headb);

structstuMark*deleteOneStuMark(structstuMark*headb);

structstuMark*deleteSchoolStuMark(structstuMark*headb);

structstuMark*readFileMark();

/*******主函数******/

voidmain()

chari;

/*用户选择的菜单*/

system("

cls"

);

printf("

****************************************\n"

*学生信息管理系统*\n"

*1学生基本信息管理*\n"

*2学生成绩信息管理*\n"

*3退出*\n"

请选择:

\n"

while(i=getchar())

{

switch(i)

{

case'

1'

:

system("

stuManage();

break;

/*如果用户选择1,则跳到学生基本信息管理的页面*/

2'

stuMarkManage();

/*如果用户选择2,则跳到学生成绩信息管理页面*/

3'

exit(0);

/*如果用户选择3,则推出程序*/

}

}

}

/*********子函数a*******/

voidstuManage()

charc;

/*定义变量*/

structstuInfor*head;

head=readFile();

/*链表*/

getchar();

while

(1)

system("

printf("

**************************************\n"

*1录入学生信息*\n"

*2更改学生信息*\n"

*3查找学生信息*\n"

*4删除学生信息*\n"

*5退出*\n"

(r/R返回主界面)\n"

c=getchar();

switch(c)

head=insertStudentMessage(head);

/*添加学生信息*/

head=changeStudentMessage(head);

/*更改学生信息*/

findStudentMessage(head);

/*查找学生信息*/

4'

head=deleteStudentMessage(head);

/*删除学生信息*/

5'

/*退出*/

r'

case'

R'

main();

/*********a1********/

structstuInfor*insertStudentMessage(structstuInfor*head)

structstuInfor*p1,*p2,*p0;

/*p0为存储输入的结构体,p1为移动链表指针p2为当前链表位置指针*/

/*用于判断是否返回*/

p1=p2=NULL;

p0=(structstuInfor*)malloc(LENstuInfor);

提示:

性别男输入m,女输入w\n\t生日格式19900425\n"

\n请输入该学生的信息:

\n学号\t姓名\t性别\t出生日期\t班级\t学院(系)\n"

scanf("

%ld\t%s\t%c\t%s\t%s\t%s"

&

p0->

stunum,p0->

name,&

sex,p0->

birthday,p0->

stuclass,p0->

school);

getchar();

if(head==NULL)/*如果头结点为空*/

head=p0;

/*把输入的节点赋给头结点*/

head->

next=NULL;

/*头结点的下一个节点为空*/

else/*如果头结点不为空*/

p2=p1=head;

/*把头结点赋给移动的指针*/

while(p0->

stunum>

=p2->

stunum&

&

p2->

next!

=NULL)/*当插入的学生学号比现在的大时就向后移动指针*/

{

p1=p2;

p2=p2->

next;

/*两个指针均向后移动*/

}

if(p0->

stunum<

stunum)

if(head==p2)

{

head=p0;

}

else

p1->

next=p0;

p0->

next=p2;

/*把p0接在链表上*/

else

p2->

是否继续(y/n)?

\t"

if(c=='

y'

||c=='

Y'

;

else

getchar();

/*读取系统缓冲字符*/

printf("

是否保存到文件(y/n)?

/*询问是否保存输入的学生信息*/

c=getchar();

if(c=='

fileSave(head);

returnhead;

stuManage();

returnhead;

/************a11***********/

voidfileSave(structstuInfor*head)

structstuInfor*p=head;

FILE*fp;

p=head;

if(head==NULL)

学生信息为空,无需保存!

"

else

if((fp=fopen("

studentInfromation.txt"

"

w"

))==NULL)

打开文件失败"

while(p!

=NULL)

if((fwrite(p,LENstuInfor,1,fp))!

=1)

printf("

保存学生信息失败"

p=p->

fclose(fp);

}

/**************a2***********/

structstuInfor*changeStudentMessage(structstuInfor*head)

structstuInfor*p;

charselect;

/*记录用户选择*/

/*用于存储用户输入得学号*/

if(p==NULL)

学生基本信息记录为空,无需更改!

!

returnhead;

while

(1)/*用于判断是否继续更改*/

system("

请输入要更改信息的学生的学号:

scanf("

%ld"

stunum);

/*输入用户要更改学生的学生的学号*/

=NULL&

stunum!

=p->

if(stunum==p->

p=changeOneStuMessage(p);

/*调用函数changeOneStuMessage()更改一个学生的信息,未保存*/

printf("

您输入的学号有误!

是否继续?

(y/n)\n"

请选择:

select=getchar();

if(select=='

||select=='

;

break;

/***********a21**********/

structstuInfor*changeOneStuMessage(structstuInfor*p)

学号姓名性别出生日期班级\t\t学校(系)\n"

if(p->

sex=='

m'

%-10ld%-10s男%-10s%-20s%-20s\n"

p->

stunum,p->

name,p->

birthday,p->

stuclass,p->

%-10ld%-10s女%-10s%-20s%-20s\n"

pause"

请输入您要更改的选项:

1、姓名\t2、性别\t3、出生日期\t4、班级\t5、学院(系)\n"

R/r返回\n"

`````````````````````\n"

select=getchar();

/*清屏*/

switch(select)

case'

请输入更正后的姓名:

%s"

name);

break;

请输入更正后的性别(男(请输入m)/女(请输入w):

%c"

p->

sex);

请输入更正后的出生年月:

(如19900425)\n"

birthday);

请输入更正后的班级:

\n"

stuclass);

请输入更正后的学院(系):

returnp;

returnp;

/**********a3*********/

voidfindStudentMessage(structstuInfor*head)/*用于查找学生的信息*/

intselect;

/*用于用户输入选择的功能*/

1查找一个学生的信息\n"

2查找一个班学生的信息\n"

3查找一个学院(系)的学生的信息\n"

4查找所有学生的记录\n"

5返回\n"

6退出\n"

``````````````````````````````````````\n"

请输入您的选择:

%d"

select);

switch(select)

case1:

findOneStuInfor(head);

/*调用函数查找一个学生的信息*/

case2:

findclassStuInfor(head);

/*调用函数查找班学生的信息*/

case3:

findSchoolStuInfor(head);

/*调用函数查一个学院(系)的所有学生信息*/

case4:

findAllStuInfor(head);

/*查找所有学生的记录*/

case5:

return;

/*返回查找的函数*/

case6:

/*退出系统*/

/*************a31*********/

voidfindOneStuInfor(structstuInfor*head)

/*定义移动链表指针*/

/*用于记录学号*/

请输入您要查询的学生的学号:

scanf("

学号姓名性别出生年月班级学校(系)\n"

while(p!

=NULL)/*当学生记录不为空时*/

if(stunum==p->

if(p->

p=p->

/***********a32*********/

voidfindclassStuInfor(structstuInfor*head)

请输入您要查询的班级:

gets(stuclass);

if(strcmp(stuclass,p->

stuclass)==0)

/***************a33*********/

voidfindSchoolStuInfor(structstuInfor*head)

请输入您要查询的学院(系):

gets(school);

if(strcmp(school,p->

{

/************a34********/

voidfindAllStuInfor(structstuInfor*head)

if(p->

%-10ld%-10s男%-10s%-

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > IT计算机 > 计算机硬件及网络

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2