学生籍贯信息记录簿C语言课程设计文档格式.docx

上传人:b****3 文档编号:15723962 上传时间:2022-11-15 格式:DOCX 页数:48 大小:282.96KB
下载 相关 举报
学生籍贯信息记录簿C语言课程设计文档格式.docx_第1页
第1页 / 共48页
学生籍贯信息记录簿C语言课程设计文档格式.docx_第2页
第2页 / 共48页
学生籍贯信息记录簿C语言课程设计文档格式.docx_第3页
第3页 / 共48页
学生籍贯信息记录簿C语言课程设计文档格式.docx_第4页
第4页 / 共48页
学生籍贯信息记录簿C语言课程设计文档格式.docx_第5页
第5页 / 共48页
点击查看更多>>
下载资源
资源描述

学生籍贯信息记录簿C语言课程设计文档格式.docx

《学生籍贯信息记录簿C语言课程设计文档格式.docx》由会员分享,可在线阅读,更多相关《学生籍贯信息记录簿C语言课程设计文档格式.docx(48页珍藏版)》请在冰豆网上搜索。

学生籍贯信息记录簿C语言课程设计文档格式.docx

3.0信息描述(注:

用流程图表示)

2.1创建信息链表并以磁盘文件保存;

/**********************建立链表******************************/

structhj

{longnumber;

charname[10],address[50];

structhj*next;

};

/*********************文件操作函数******************************/

FILE*fp;

voidopenfile(charxx[20])

{

fp=fopen(xx,"

ab+"

);

if(fp==NULL)

wb"

}

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

intmain(intargc,char*argv[])

{

begin:

intt;

system("

cls"

printf("

\n★★★★★欢迎使用户籍管理系统★★★★★\n\n\n\n\n"

一录入学生籍贯信息\n\n"

二查编学生籍贯信息\n\n"

三删除学生籍贯信息\n\n"

四退出程序\n\n"

请您选择:

"

mm:

scanf("

%d"

&

t);

switch(t)

{

case1:

hjnew();

break;

case2:

hjselect();

case3:

hjde();

case4:

exit(0);

default:

printf("

\n错误的选择,请重新选择:

gotomm;

}

gotobegin;

return0;

}

2.2读取磁盘文件并显示输出所有学生的籍贯信息;

voidallselect(chara[8])//全部查询

intn=0;

intk=0;

\n★★★★★欢迎使用户籍管理系统★★★★★\n"

\n★★★籍贯方式信息★★★\n\n\n"

structhj*p;

structhj*q=NULL,*head=NULL;

fp=fopen(a,"

rb"

{

\n对不起,没有记录无法查询!

gotoxxxx;

rewind(fp);

while(!

feof(fp))

n++;

p=(structhj*)malloc(sizeof(structhj));

fread(p,sizeof(structhj),1,fp);

if(n==1)

head=p;

else

q->

next=p;

q=p;

q->

next=NULL;

structhj*h1,*p2,*q3,*r4,*s5;

h1=p2=(hj*)malloc(sizeof(structhj));

p2->

next=head;

while(p2->

next!

=NULL)

q3=p2->

next;

r4=p2;

while(q3->

if(q3->

next->

number<

p2->

number)

r4=q3;

q3=q3->

}

if(r4!

=p2)

s5=r4->

r4->

next=s5->

s5->

next=p2->

next=s5;

p2=p2->

head=h1->

free(h1);

p=head;

while(p!

=NULL&

&

n>

0)

n--;

\n学号=%ld姓名=%s"

p->

number,p->

name);

\n地址=%s"

address);

p=p->

xxxx:

\n→显示完毕←\n⑴↑返回上级菜单⑵↓退出程序\n请选择:

xxx:

n);

switch(n)

\n错误的选择,请重新选择:

gotoxxx;

voidhjselect(void)//查询编辑信息函数

cxbegin:

inta;

\n★★★查询编辑信息★★★\n\n\n"

\n一按学号方式查询\n"

\n二按姓名方式查询\n"

\n三按籍贯方式查询\n"

\n四→显示全部信息\n"

\n五←返回上级菜单\n"

\n请选择查询方式:

cxmm:

a);

switch(a)

hjxmselect();

gotocxbegin;

hjxhselect();

hjjgselect();

allselect("

hj.txt"

case5:

break;

gotocxmm;

2.3按学号或姓名查询其籍贯;

/*****************************查询函数*************************/

voidhjxmselect(void)//按学号方式查询函数

ssmmx:

longhh;

\n★★★查询编辑信息★★★\n"

\n〓提示输入0返回上级菜单〓\n\n\n"

请您输入学号:

%ld"

hh);

if(hh!

=0)

structhj*q=NULL,*head=NULL;

fp=fopen("

"

\n没有记录,请输入记录然后再查询!

getch();

gotojjx;

=NULL)

if(p->

number==hh)

\n结果→学号=%ld姓名=%s"

\n地址=%s"

\n\n操作→⑴更改数据⑵删除数据⑶查询其他数据⑷返回上页⑸退出程序\n\n请您选择操作:

ssmx:

voidhjedit(structhj*headd,structhj*pp);

voidhjdelete(structhj*headdd,structhj*ss);

hjedit(head,p);

gotossmmx;

hjdelete(head,p);

gotossmx;

intiiii=0;

\n没有此记录1.重新查询2.返回上一页3.退出程序!

\n请选择:

qqqq:

iiii);

switch(iiii)

exit(0);

gotoqqqq;

jjx:

;

voidhjxhselect(void)//按姓名方式查询函数

ssmm:

charhh[10];

请您输入姓名:

%s"

hh);

if(strcmp(hh,"

0"

)!

pr

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

当前位置:首页 > 经管营销 > 经济市场

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1