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

当前位置:首页 > 《C语言程序设计》课程设计报告(图书信息管理系统)

《C语言程序设计》课程设计报告(图书信息管理系统)

  • 62 次阅读
  • 3 次下载
  • 2025/7/4 16:28:35

{ head=p1; head->next=NULL; } else { while((p1->num>p2->num)&&(p2->next!=NULL)) { p3=p2; p2=p2->next; } if(p1->num<=p2->num) { if(head==p2) head=p1; else p3->next=p1; p1->next=p2; } else { p2->next=p1; p1->next=NULL; } } return head; }

/*....................................................查询功能...................................................*/ void Check(struct bookinf * head) //查询,书名,作者名 { struct bookinf * ptr; char a; char bname[10]; char wname[10]; printf(\ printf(\ scanf(\ if(head==NULL) printf(\ else //链表非空 { switch(a) {

case '1': //按书名查询 printf(\ scanf(\ for(ptr=head;ptr;ptr=ptr->next) { if(strcmp(ptr->bname,bname)==0 ) { printf(\ dlnum bname aname scnum plname time price\\n\

printf(\

ptr->clanum,ptr->pubcom,ptr->pubtime,ptr->price); if(ptr==NULL) printf(\ } } break; case '2': //按作者名查询 printf(\ scanf(\ for(ptr=head;ptr;ptr=ptr->next) { if(strcmp(ptr->wname,wname)==0) { printf(\ num bname wname clanum pubcom pubtime price\\n\

printf(\

ptr->clanum,ptr->pubcom,ptr->pubtime,ptr->price); if(ptr==NULL) printf(\ } } break; default: printf(\ break; } } }

/*..................................................浏览功能..............................................*/ void Ptrint_Stu_Doc(struct bookinf *head)//浏览 { struct bookinf * ptr; if(head==NULL) printf(\ else { printf(\ printf(\ ptr=head; while(ptr!=NULL) { printf(\%ld %s %s %s %s %s %6.3f \\n\

ptr=ptr->next; } } }

/*.................................................修改功能.........................................................*/ struct bookinf * Revise(struct bookinf * head) //定义子函数 { struct bookinf * p1; int num;

char bname[20]; char wname[10]; char clanum[14]; char pubcom[10]; char pubtime[10]; float price; printf(\输出 scanf(\读取 长整形输出 if(head==NULL) //开头空 printf(\输出没结果 换行 else { for(p1=head;p1;p1=p1->next) { if(p1->num=num) { printf(\om,p1->pubtime,p1->price); //字节 大小

printf(\输出

scanf(\//读

p1->num=num; strcpy(p1->bname,bname); //读取 strcpy(p1->wname,wname); strcpy(p1->clanum,clanum); strcpy(p1->pubcom,pubcom); strcpy(p1->pubtime,pubtime); p1->price=price; } break; //退出循环 } if(p1==NULL)// p1空 printf(\ } return head; }

/*.............................................................删除功能...................................................*/ struct bookinf * Delete(struct bookinf * head) //删除 { struct bookinf * ptr1,* ptr2; //定义 指针1 2 int num; printf(\ scanf(\ if(head==NULL) //链表空 return NULL; else { while(head!=NULL && head->num==num) //要被删除结点为表头结点 { ptr2=head; head=head->next; printf(\ num bname wname clanum pubcom pubtime price\\n\

printf(\字节

ptr2->clanum,ptr2->pubcom,ptr2->pubtime,ptr2->price); free(ptr2); //释放 } //要被删除结点为非表头结点 ptr1=head;

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

共分享92篇相关文档

文档简介:

{ head=p1; head->next=NULL; } else { while((p1->num>p2->num)&&(p2->next!=NULL)) { p3=p2; p2=p2->next; } if(p1->numnum) { if(head==p2) head=p1; else p3->next=p1; p1->next=p2; } else { p2->next=p1; p1->next=NULL; } } return 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