学籍管理系统代码可运行Word文档格式.docx
- 文档编号:15060172
- 上传时间:2022-10-27
- 格式:DOCX
- 页数:32
- 大小:20.25KB
学籍管理系统代码可运行Word文档格式.docx
《学籍管理系统代码可运行Word文档格式.docx》由会员分享,可在线阅读,更多相关《学籍管理系统代码可运行Word文档格式.docx(32页珍藏版)》请在冰豆网上搜索。
};
intTOTAL_NUM=0;
structstudent*head=NULL;
voidwelcome();
voidmainmenu();
voidrecord();
voidinsert(structstudent*stu);
voiddisplay(structstudent*stu);
voiddisplayAll();
voidquery();
voidquery_by_num();
voidquery_by_name();
voidreadData();
voidwriteData();
voidfreeAll();
voiddel();
voidchange();
voiddevise(structstudent*p);
intmain()
charuserName[9];
charuserPWD[7];
inti;
welcome();
for(i=0;
i<
3;
i++)
{
printf("
\n管理员初始用户名和密码均为admin\n"
);
请输入您的用户名:
"
scanf("
%s"
userName);
\n请输入您的密码:
userPWD);
if((strcmp(userName,"
admin"
)==0)&
&
(strcmp(userPWD,"
)==0))
//用户名和密码正确,显示主菜单
mainmenu();
break;
}
else
if(i<
2)
//用户名或密码错误,提示用户重新输入
用户名或密码错误,请重新输入!
//连续3次输错用户名或密码,退出系统。
您已连续3次将用户名或密码输错,系统将退出!
return0;
}
//显示欢迎信息
voidwelcome()
+---------------------------+\n"
||\n"
|欢迎使用学生信息管理系统|\n"
//系统主菜单
voidmainmenu()
intchoice;
choice=-1;
readData();
\n温馨提示:
为保证您的操作得到保存,请按正常顺序退出系统^_^\n"
do
\n\n\n"
\t\t\t--------------------------------\n"
\t\t\t+学生信息管理系统|\n"
\t\t\t+[1]----录入学生信息|\n"
\t\t\t+[2]----浏览学生信息|\n"
\t\t\t+[3]----查询学生信息|\n"
\t\t\t+[4]----删除学生信息|\n"
\t\t\t+[5]----修改学生信息|\n"
\t\t\t+[0]----退出系统|\n"
\t\t\t+*·
*·
|\n"
请输入您的选择:
%d"
&
choice);
switch(choice)
case0:
writeData();
freeAll();
exit(0);
case1:
record();
case2:
displayAll();
case3:
query();
case4:
del();
case5:
change();
default:
\n无效选项!
while(choice!
=0);
//录入学生信息
voidrecord()
{
structstudent*p0;
p0=(structstudent*)malloc(LEN);
请输入学生的学号:
%ld"
&
p0->
num);
请输入学生的姓名:
p0->
name);
请输入学生的年龄:
age);
请输入学生的性别:
sex);
请输入学生的出生年月:
birthday);
请输入学生的地址:
address);
请输入学生的电话:
tele_num);
请输入学生的E-mail:
E_mail);
insert(p0);
该学生的信息为:
\n"
-------------------------------------------------------------------------------"
学号\t姓名\t年龄\t性别\t出生年月\t\t地址\t电话\tE-mail\n"
display(p0);
voidinsert(structstudent*stu)
structstudent*p0,*p1,*p2;
p1=head;
p0=stu;
if(head==NULL)
head=p0;
p0->
next=NULL;
while((p0->
num>
p1->
num)&
(p1->
next!
=NULL))
p2=p1;
p1=p1->
next;
if(p0->
num<
=p1->
num)
if(head==p1)
p2->
next=p0;
next=p1;
}
TOTAL_NUM++;
voiddisplay(structstudent*p)
%ld\t%s\t%d\t%s\t%s\t%s\t%ld\t%s\n"
p->
num,p->
name,p->
age,p->
sex,p->
birthday,p->
address,p->
tele_num,p->
//浏览学生信息
voiddisplayAll()
structstudent*p;
学生总数:
%d\n"
TOTAL_NUM);
p=head;
if(head!
=NULL)
{
\n学号\t姓名\t年龄\t性别\t出生年月\t地址\t电话\tE-mail\n"
display(p);
p=p->
while(p!
=NULL);
//查询学生信息
voidquery()
+--------------------+\n"
|按学号查询请按1|\n"
|按姓名查询请按2|\n"
|取消请按0|\n"
return;
query_by_num();
query_by_name();
//按学号查询学生信息
voidquery_by_num()
intnum;
structstudent*p1;
请输入学生的学号:
if(head==NULL)
无学生记录!
p1=head;
while(num!
=p1->
num&
next!
=NULL)
p1=p1->
if(num==p1->
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 学籍 管理 系统 代码 运行