C语言学生信息管理系统实验报告Word格式文档下载.docx

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

C语言学生信息管理系统实验报告Word格式文档下载.docx

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

C语言学生信息管理系统实验报告Word格式文档下载.docx

进入

退出

学生信息录入

学生信息查找

学生信息浏览

学生信息删除

学生信息修改

学生信息增加

返回主菜单

2.2、函数功能和函数之间的调用关系

2.2.1、函数功能:

voidMenu_1();

//主菜单

voidMenu_2();

//二级菜单

voidswap(structstudent*phead,structstudent*pback);

//链表节点互换

voidSave(structstudent*head);

//写入磁盘

voidSearch(structstudent*head);

//查找学生信息

voidRead(structstudent*head);

//显示学生信息

voidSort(structstudent*head);

//链表节点排序

structstudent*Create();

//学生信息手动录入

structstudent*Readpoint();

//磁盘文件写入内存

structstudent*Modify(structstudent*head);

//链表结构体成员修改

structstudent*Add(structstudent*head);

//链表节点插入

structstudent*Delete(structstudent*head);

//链表节点删除

2.2.2、函数之间的调用关系:

通过switch语句进行指令选择:

case1:

学生信息录入

调用函数Create()、Save()、Menu_1()、Menu_2()

case2:

学生信息浏览

调用函数Readpoint()、Sort()、Read()、Save()、Menu_1()、Menu_2()

case3:

学生信息查找

调用函数Search()、Readpoint()、Menu_1()、Menu_2()

case4:

学生信息修改

调用函数Modify()、Readpoint()、Save()、Menu_1()、Menu_2()

case5:

学生信息增加

调用函数Add()、Readpoint()、Save()、Menu_1()、Menu_2()

case6:

学生信息删除

调用函数Delete()、Readpoint()Save()、Menu_1()、Menu_2()

case0:

返回主菜单

调用函数Menu_1()

第三章、代码(源代码)

/*

学生信息管理系统

*/

#include<

stdio.h>

stdlib.h>

string.h>

structstudent//定义结构体

{

intnum;

charname[24];

charsex[5];

intChinese;

intMath;

intEnglish;

structstudent*next;

};

//链表节点互换

//学生信息手动录入

//链表结构体成员修改

intmain(void)

Menu_1();

return0;

}

voidMenu_1()

printf("

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

);

\t\t\t1:

进入学生信息管理\n"

\t\t\t0:

退出学生信息管理\n"

请您输入指令:

"

scanf("

%d"

&

num);

switch(num)

{case1:

Menu_2();

break;

default:

printf("

-----------------------------------------您已退出学生信息管理系统-----------------------------------------------\n"

break;

}

/*------------------------------------------------------------------------------------------------------------------------------------*/

voidMenu_2()

{

structstudent*head;

intnum;

\t\t\t欢迎进入\n"

-----------------------------------------------------------------------------------------------------------------------\n"

学生信息录入\n"

\t\t\t2:

学生信息浏览\n"

\t\t\t3:

学生信息查找\n"

\t\t\t4:

学生信息修改\n"

\t\t\t5:

学生信息增加\n"

\t\t\t6:

学生信息删除\n"

返回主菜单\n"

------------------------------------------------------------------------------------------------------------------------\n"

scanf("

switch(num)

head=Create();

Save(head);

\n"

//手动录入学生数据

返回二级菜单\n"

{

case1:

Menu_1();

case2:

default:

{

printf("

输入无效,返回二级菜单!

Menu_2();

}

head=Readpoint();

//写入链表,返回头指针

Sort(head);

\t\t\t以学号升序排列\n"

Read(head);

//链表数据写入文件

Search(head);

//查找学生信息

返回主菜单\n"

返回二级菜单\n"

Modify(head);

//修改结构体成员并保存到文件

Add(head);

//增加学生信息并保存到文件

head=Delete(head);

//删除学生信息并保存到文件

default:

请重新输入\n"

Menu_2();

/*---------------------------------------------------------------------------------------------------------------------------------------*/

structstudent*Create()//学生信息手动录入

structstudent*head,*p,*q;

intn;

p=q=(structstudent*)malloc(sizeof(structstudent));

请输入学生的姓名、学号、性别、语文成绩、高等数学成绩、英语成绩:

%s"

q->

name);

%d%s%d%d%d"

q->

num,&

sex,&

Chinese,&

Math,&

English);

n=0;

head=NULL;

while(q->

num!

=0)

n=n+1;

if(n==1)

head=q;

else

p->

next=q;

p=q;

q=(structstudent*)malloc(sizeof(structstudent));

scanf("

num,q->

p->

next=NULL;

学生信息录入成功!

returnhead;

/*----------------------------------------------------------------------------------------------------------------------------------------*/

structstudent*Readpoint()//学生信息写入内存,便于操作

FILE*fp1;

if((fp1=fopen("

E:

test.txt"

"

rb"

))==NULL)

printf("

openfileerror!

exit(0);

fscanf(fp1,"

%s%d%s%d%d%d"

name,&

while(!

feof(fp1))

fscanf(fp1,"

fclose(fp1);

voidSwap(structstudent*phead,structstudent*pback)//链表元素数据交换

structstudent*temp=(structstudent*)malloc(sizeof(structstudent));

strcpy(temp->

name,phead->

temp->

num=phead->

num;

sex,phead->

sex);

Chinese=phead->

Chinese;

Math=phead->

Math;

English=phead->

English;

strcpy(phead->

name,pback->

phead->

num=pback->

sex,pback->

Chinese=pback->

Math=pback->

English=pback->

strcpy(pback->

name,temp->

pback->

num=temp->

sex,temp->

Chinese=temp->

Math=temp->

English=temp->

free(temp);

voidSort(structstudent*head)//学号排序

structstudent*phead=(structstudent*)malloc(sizeof(structstudent));

structstudent*pback=(structstudent*)malloc(sizeof(structstudent));

phead=head;

while(phead)

intNum=phead->

pback=phead->

next;

while(pback)

if(Num>

num)

{

Swap(phead,pback);

Num=phead->

}

pback=pback->

phead=phead->

voidRead(structstudent*head)//学生信息读取

structstudent*p;

p=head;

学生的姓名、学号、性别、语文成绩、高等数学成绩、英语成绩:

while(p!

=NULL)

%s\t%d\t%s\t%d\t%d\t\t%d\n"

p->

name,p->

num,p->

sex,p->

Chinese,p->

Math,p->

p=p->

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

当前位置:首页 > 解决方案 > 学习计划

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

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