云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > C语言实习设计报告(学生公寓管理管理系统)

C语言实习设计报告(学生公寓管理管理系统)

  • 62 次阅读
  • 3 次下载
  • 2025/5/6 15:19:46

printf(\ scanf(\ printf(\ scanf(\

printf(\ scanf(\

printf(\

scanf(\

p2->next=p1; /*将新结点连到表尾*/ p2=p1; /*p2指向新的表尾*/ }

p2->next=NULL; head=head->next; }

save_message(head); /*将输入的数据存入文件*/ return head; }

/*输入模块*/ input_message() {

clrscr(); h=creat();

printf(\ press any key to the main meue!!!!\\n\ bioskey(0); }

/*读取信息*/ read_message()

{ struct stud *p1,*p2;

h=p1=(struct stud*)malloc(N); /*为了p1申请存储空间,并指向首结点*/ if((fp=fopen(\

{ printf(\ There is no data for the monent!\\n\ return; }

if(fread(p1,N,1,fp)!=1) return; /*先向p1读入一个数据,若不能读,返回*/ while(1)

{ p2=(struct stud*)malloc(N); /*为了p2申请存储空间*/ if(fread(p2,N,1,fp)!=1) break; p1->next=p2; p1=p2; }

fclose(fp); bioskey(0);

}

/*输出模块*/

output_message(struct stud *p) { p=h; clrscr();

if(p==NULL)

printf(\ There is no datas right now!\\n\

printf(\ name sex age major grade class building floor dormitary\\n\\n\ while(p!=NULL) {

printf(\or,p->grade,p->classes,p->building,p->floor,p->dormitary); p=p->next; }

printf(\ press any key to the main meue!!!!\\n\ bioskey(0); }

/*删除学生信息*/

del_message(struct stud *h) { int num;

struct stud *p,*p0; clrscr();

if(h==NULL) return 0;

printf(\ Please input the number who you what to delete?\\n\ scanf(\ p0=h;

if(p0->num==num) { h=p0->next;

free(p0); /*若首结点是所要删除的数据,则释放首结点*/

return 1; }

p=p0->next; while(p!=NULL) { if(p->num==num) { p0->next=p->next; free(p); return 1; } p0=p;

p=p->next; }

return 0; }

/*修改学生信息*/ revise_message() { int num1,choice; struct stud *p0; clrscr();

printf(\ Please input the number who you what to revise:\\n\ scanf(\ clrscr();

p0=h; /*将头结点赋给p0*/ do

{ if(p0->num==num1)

{ printf(\ Which you what to revise?\\n\ printf(\ 1.number\\n\ printf(\ 2.name\\n\ printf(\ 3.sex\\n\ printf(\ 4.age\\n\ printf(\ 5.major\\n\ printf(\ 6.grade\\n\ printf(\ 7.class\\n\ printf(\ 8.building\\n\ printf(\ 9.floor\\n\

printf(\ 10.dormiatry\\n\ scanf(\ switch(choice)

{ case 1:printf(\ Input the new number:\\n\ scanf(\

case 2:printf(\ Input the new name:\\n\ scanf(\

case 3:printf(\ Input the new sex:\\n\ scanf(\

case 4:printf(\ Input the new age:\\n\ scanf(\

case 5:printf(\ Input the new major:\\n\ scanf(\

case 6:printf(\ Input the new grade:\\n\ scanf(\

case 7:printf(\ Input the new class:\\n\ scanf(\

case 8:printf(\ Input the new building:\\n\

scanf(\

case 9:printf(\ Input the new floor:\\n\ scanf(\

case 10:printf(\ Input the new dormitary:\\n\ scanf(\ }

break; }

else p0=p0->next; }while(p0!=NULL); }

/*插入学生信息*/

insert_message(struct stud *h) { struct stud *p,*p0;

p=(struct stud *)malloc(N); clrscr();

printf(\ scanf(\ printf(\ scanf(\

printf(\ scanf(\

printf(\ scanf(\

printf(\ scanf(\

printf(\ scanf(\

printf(\ scanf(\ p->next=NULL; if(h==NULL) { h=p; return 1; } p0=h;

if((p0->num)>(p->num)) /*按学号顺序插入*/ { p->next=h; h=p; return 1; }

while((p0->next)!=NULL&&(p0->next->num)<(p->num)) p0=p0->next;

  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

printf(\ scanf(\ printf(\ scanf(\ printf(\ scanf(\ printf(\ scanf(\ p2->next=p1; /*将新结点连到表尾*/ p2=p1; /*p2指向新的表尾*/ } p2->next=NULL; head=head->next; } save_message(head); /

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com