C语言图书管理系统课程设计报告 - 副本(2)
for(;p!=NULL;p=p->next) { }
fclose(fp);
printf("信息已保存。"); }
void holdcx(link *t) {
link *p=NULL; FILE *fp;
fp=fopen("查询.txt","a+"); p=t;
fprintf(fp,"查询到的信息为:\n"); fprintf(fp,"\n");
fprintf(fp,"\n**************************************fprintf(fp,"\n编号\t\t书名\t\t作者\t\t出版社\t\t出fprintf(fp,"\n");
fprintf(fp,"%s\t%s\t%s\t%s\t%s",p->number,p->booknamfprintf(fp,"\t\t%.2f",p->price);
fprintf(fp,"%s\t%s\t%s\t%s\t%s",p->number,p->booknamfprintf(fp,"\t\t%.2f",p->price); fprintf(fp,"\t\t%s",p->status); fprintf(fp,"\n");
e,p->author,p->publish,p->time);
************\n");
版时间\t\t价格\t\t状态\n");
e,p->author,p->publish,p->time);
}
fprintf(fp,"\t\t%s",p->status); fprintf(fp,"\n"); fclose(fp);
printf("信息已保存!!!");
link *findnumber(link *head) {
char key[100]; link *h,*t1=NULL;
printf("请输入图书的编号:"); getchar(); gets(key);
for(h=head;h!=NULL;h=h->next) {
if(strcmp(key,h->number)==0) { }
return t1; }
link *findboookname(link *head) {
char key[100]; link *h,*t2=NULL;
t1=h; break;
}
printf("请输入图书的书名:"); getchar(); gets(key);
for(h=head;h!=NULL;h=h->next) {
if(strcmp(key,h->bookname)==0) { }
return t2; }
link *findauthor(link *head) {
char key[100]; link *h,*t3=NULL;
printf("请输入作者姓名:"); getchar(); gets(key);
for(h=head;h!=NULL;h=h->next) {
if(strcmp(key,h->author)==0) {
t3=h; break; t2=h; break;
}
}
}
return t3; }
link *sortnumber(link *head) {
link *p,*q,*temp;
temp=(link *)malloc(sizeof(link)); if(temp==NULL) { }
for(p=head;p!=NULL;p=p->next) {
{
if(strcmp(p->number,q->number)>0) strcpy(temp->number,p->number); strcpy(temp->bookname,p->bookname); strcpy(temp->author,p->author); strcpy(temp->publish,p->publish); strcpy(temp->time,p->time); temp->price=p->price;
strcpy(temp->status,p->status);
strcpy(p->number,q->number); {
printf("申请内存出错!!!"); exit(1);
for(q=p->next;q!=NULL;q=q->next)
}
strcpy(p->bookname,q->bookname); strcpy(p->author,q->author); strcpy(p->publish,q->publish); strcpy(p->time,q->time); p->price=q->price;
strcpy(p->status,temp->status);
strcpy(q->bookname,temp->bookname); strcpy(q->author,temp->author); strcpy(q->publish,temp->publish); strcpy(q->time,temp->time); q->price=temp->price;
strcpy(q->status,temp->status);
strcpy(q->number,temp->number);
} }
}
return head;
link *borrowbook(link *head) {
link *h,*p;
char ch,ch1[100]="在库",ch2[100]="不在库"; h=head;
printf("\n******************************************printf("\t\t欢迎使用借书系统!!!\n");
********\n");
}
p=findboookname(h); if(p==NULL)
printf("借书失败,书库中没有这本书!!!"); else if(strcmp(p->status,ch2)==0) printf("借书失败,图书不在库!!!"); else {
printf("确认借出?Y/N:"); scanf("%c",&ch); getchar();
if(ch=='Y'||ch=='y') {
strcpy(p->status,ch2); }
if(ch=='N'||ch=='n') { } }
printf("你没有借任何书!!!");
printf("借书成功,请返回上级菜单保存信息!!!");
return head;
link *returnbook(link *head) {
link *h,*p;
char ch,ch1[100]="在库",ch2[100]="不在库"; h=head;
printf("\n******************************************printf("\t\t欢迎使用还书系统!!!\n"); p=findboookname(h); if(p==NULL)
printf("还书失败,这不是本书库的书!!");
********\n");
else {
printf("确认还书?Y/N:"); scanf("%c",&ch);
getchar(); if(ch=='Y'||ch=='y') {
strcpy(p->status,ch1);
printf("还书成功,请返回上级菜单保存信息!!!"); }
if(ch=='N'||ch=='n') { }
printf("你没有还书!!!");
}
return head; }
void main() {
int a,b,c,d; link *h,*t;
…… 此处隐藏:1044字,全部文档内容请下载后查看。喜欢就下载吧 ……
相关推荐:
- [初中教育]婚姻家庭法学教学教案
- [初中教育]浅谈小学语文教学中的创新教育
- [初中教育]中华人民共和国侵权责任法2009
- [初中教育]2016-2022年中国薄膜太阳能电池行业发
- [初中教育]多级轻型井点降水的应用
- [初中教育]外语教学法流派介绍和简评
- [初中教育]实验一、典型环节及其阶跃响应
- [初中教育]内蒙古2012-2013学年度国家奖学金获奖
- [初中教育]移动通信营销渠道管理探讨
- [初中教育]初三化学第一学期第一第二章基础知识点
- [初中教育]一天的食物教学设计
- [初中教育]光导照明系统的基本结构及工作原理
- [初中教育]长春市十一高、东北师范大学附属中学、
- [初中教育]“十三五”规划重点-配重式装卸车项目
- [初中教育]领导方法和领导艺术
- [初中教育]第三章 植物病虫草鼠害诊断与防治基
- [初中教育]2019届九年级语文上册 第二单元 6纪念
- [初中教育]甲级单位编制水豆腐项目可行性报告(立
- [初中教育]Ch8-1补充 09101数据库系统原理及应用-
- [初中教育]2017-2023年中国吊装设备行业市场分析
- 制作毕业纪念册需要哪些材料
- 2015-2016学年高二化学苏教版选修4课件
- 哈佛管理导师-创建商业案例
- 职场交际中的谈吐礼仪知识与职场会议接
- 中国糕点及面包行业发展现状与竞争战略
- 沂河“12·7”洪水茶山拦河坝
- 管道水流量计算公式
- 4-2发电机火灾事故处置方案
- 数字信号处理实验五
- 2009年经济师(中级)金融专业知识全真试
- 历史街区保护规划--04历史文化遗产保护
- 宁夏回族自治区中小学职称评价标准
- 评先评优测评表
- 圆的切线证明及线段长求解在在中考中的
- 【解析版】2015年江苏省南京外国语学校
- 人教版八年级上册科学第一章习题精华
- 责任心与执行力
- SA8000社会责任管理体系标准培训
- IgA肾病的饮食应注意
- 杭州市建设工程文件归档整理方案(试行)




