学生教员管理系统Word文档格式.docx
- 文档编号:19260745
- 上传时间:2023-01-04
- 格式:DOCX
- 页数:36
- 大小:22.51KB
学生教员管理系统Word文档格式.docx
《学生教员管理系统Word文档格式.docx》由会员分享,可在线阅读,更多相关《学生教员管理系统Word文档格式.docx(36页珍藏版)》请在冰豆网上搜索。
//建立学生信息链表
voidcreat()
stuPtrp1,q1,head1;
stuPtr0p2,q2,head2;
head1=(stuPtr)malloc(sizeof(stuNode));
p1=(stuPtr)malloc(sizeof(stuNode));
q1=(stuPtr)malloc(sizeof(stuNode));
q1->
next=NULL;
p1->
next=q1;
head1->
next=p1;
head2=(stuPtr0)malloc(sizeof(stuNode0));
p2=(stuPtr0)malloc(sizeof(stuNode0));
q2=(stuPtr0)malloc(sizeof(stuNode0));
q2->
p2->
next=q2;
head2->
next=p2;
number=p2->
number=1;
strcpy(p1->
name,"
li"
);
age=20;
sex='
F'
;
grade1=90;
grade2=87.5;
grade3=92;
secret=111111;
number=q2->
number=2;
strcpy(q1->
mao"
age=21;
M'
grade1=93;
grade2=88;
grade3=91;
stuwrite1(head1);
stuwrite2(head2);
}
//按学号由小到大添加学生节点(管理员)
stuPtradd(stuPtrhead)
stuNode*p,*q;
p=(stuPtr)malloc(sizeof(stuNode));
printf("
学生学号:
\n"
学号禁止设0\n"
scanf("
%d"
&
(p->
number));
getchar();
学生姓名:
gets(p->
name);
学生年龄:
age));
学生性别:
%c"
sex));
p->
grade1=0;
grade2=0;
grade3=0;
q=head;
while(q->
next!
=NULL&
&
number>
q->
next->
number)
{
q=q->
next;
}
p->
next=q->
q->
next=p;
stuwrite1(head);
p=sturead1();
returnp;
//添加学生密码
stuPtr0add0(stuPtr0head)
stuPtr0p,q;
p=(stuPtr0)malloc(sizeof(stuNode0));
同一个学生学号:
q=q->
stuwrite2(head);
p=sturead2();
//所需查找的学生的前一人
stuPtrseek(stuPtrhead,intnum)
intflag,choose;
stuPtrp;
p=head;
while(p->
=NULL)
flag=0;
if(num==p->
{
flag=1;
break;
}
p=p->
if(flag==1)
returnp;
else
printf("
没有此人\n\n"
returnNULL;
//被查找学生前一人的密码信息
stuPtr0seek0(stuPtr0head,intnum)
stuPtr0p;
flag=0;
if(num==p->
flag=1;
break;
p=p->
returnNULL;
//显示被查找学生的信息
voidsomeone(stuPtrp)
学号\t姓名\t年龄\t性别\t数学成绩\tC语言成绩\t语文成绩\n"
%d\t%s\t%d\t%c\t%.1f\t\t%.1f\t\t%.1f\n\n"
p->
number,p->
name,p->
age,p->
sex,p->
grade1,p->
grade2,p->
grade3);
//显示被查找学生的成绩信息
voidsomeonegrade(stuPtrp)
学号\t姓名\t数学成绩\tC语言成绩\t语文成绩\n"
%d\t%s\t%.1f\t\t%.1f\t\t%.1f\n\n"
//显示被管理员查找的学生的信息
voidsomeonenograde(stuPtrp)
学号\t姓名\t年龄\t性别\n"
%d\t%s\t%d\t%c\n\n"
sex);
}
//删除学生
stuPtrdelet(stuPtrhead,intnum)
stuNode*p1,*p2;
p1=seek(head,num);
p2=p1->
next=p2->
free(p2);
p2=NULL;
p1=sturead1();
returnp1;
//删除学生的密码信息
stuPtr0delet0(stuPtr0head,intnum)
stuNode0*p1,*p2;
p1=seek0(head,num);
p1=sturead2();
//显示所有学生的信息
voidprint(stuPtrhead)
inti;
p=head->
while(p!
if(p->
0&
age>
0)
printf("
%d\t%s\t%d\t%c\t%.1f\t\t%.1f\t\t%.1f\n"
//显示所有学生的成绩信息
voidprintgrade(stuPtrhead)
0&
%d\t%s\t%.1f\t\t%.1f\t\t%.1f\n"
//显示管理员所能查看的学生信息
voidprintnograde(stuPtrhead)
0)
%d\t%s\t%d\t%c\n"
//教师信息结构体
structteacher
intgrade;
structteacher*next;
//教师登录密码结构体
structteacher1
structteacher1*next;
typedefstructteacherteaNode;
typedefstructteacher*teaPtr;
typedefstructteacher1teaNode0;
typedefstructteacher1*teaPtr0;
intteawrite1(teaPtr);
intteawrite2(teaPtr0);
teaPtrtearead1();
teaPtr0tearead2();
//建立教师信息链表
voidcreat1()
teaPtrhead1,p1,q1;
teaPtr0head2,p2,q2;
head1=(teaPtr)malloc(sizeof(teaNode));
p1=(teaPtr)malloc(sizeof(teaNode));
q1=(teaPtr)malloc(sizeof(teaNode));
head2=(teaPtr0)malloc(sizeof(teaNode0));
p2=(teaPtr0)malloc(sizeof(teaNode0));
q2=(teaPtr0)malloc(sizeof(teaNode0));
gu"
age=30;
grade=2;
zhang"
age=32;
teawrite1(head1);
teawrite2(head2);
//按工号由小到大添加节点
teaPtradd1(teaPtrhead)
teaPtrp,q;
p=(teaPtr)malloc(sizeof(teaNode));
教师工号:
工号禁止设0\n"
教师姓名:
教师年龄:
教师性别:
教师班级:
grade));
teawrite1(head);
p=tearead1();
//添加教师密码
teaPtr0add10(teaPtr0head)
teaPtr0p,q;
p=(teaPtr0)malloc(sizeof(teaNode0));
同一个教师工号:
teawrite2(head);
p=tearead2();
//所需查找的教师的前一人
teaPtrseek1(teaPtrhead,intnum)
teaPtrp;
//所需查找教师前一人的密码信息
teaPtr0seek10(teaPtr0head,intnum)
teaPtr0p;
//显示被查找教师的信息
voidsomeone1(teaPtrp)
工号\t姓名\t年龄\t性别\t班级\n"
%d\t%s\t%d\t%c\t%d\n\n"
grade);
//删除教师
teaPtrdelet1(teaPtrhead,intnum)
teaPtrp1,p2;
p1=seek1(head,num);
teawrite1(head);
p1=tearead1();
//删除教师密码
teaPtr0delet10(teaPtr0head,intnum)
teaPtr0p1,p2;
p1=seek10(head,num);
p1=tearead2();
//显示所有教师的信息
voidprint1(teaPtrhead)
=NULL)
if(p->
{
%d\t%s\t%d\t%c\t%d\n"
}
//学生密码存入文件
intstuwrite2(stuPtr0p)
FILE*q;
q=fopen("
stu_passwd.conf"
"
w"
fwrite(p,sizeof(stuNode0),1,q);
fclose(q);
return0;
//学生信息存入文件
intstuwrite1(stuPtrp)
stu_info.dat"
fwrite(p,sizeof(stuNode),1,q);
//教师密码存入文件
intteawrite2(teaPtr0p)
teach_passwd.conf"
fwrite(p,sizeof(teaNode0),1,q);
//教师信息存入文件
intteawrite1(teaPtrp)
teach_info.dat"
fwrite(p,sizeof(teaNode),1,q);
//学生密码从文件中读出
stuPtr0sturead2()
stuPtr0head,p1,p2;
inta;
head=(stuPtr0)malloc(sizeof(stuNode0));
head->
p1=head;
r"
do
p2=(stuPtr0)malloc(sizeof(stuNode0));
p2->
a=fread(p2,sizeof(stuNode0),1,q);
p1->
p1=p2;
}while(a==1);
returnhead;
//学生信息从文件中读出
stuPtrsturead1()
stuPtrhead,p1,p2;
head=(stuPtr)malloc(sizeof(stuNode));
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 学生 教员 管理 系统