3、ntf("cannotopeninfile");}for(i=0;inum!=0)p++;printf("请输入书名");scanf("%s",p->name)
4、;printf("请输入编号");scanf("%d",&p->num);printf("请输入作者");scanf("%s",p->author);printf("请输入单价");scanf("%d",&p->price);p->state=1;strcpy(p->bow_name,"");p->sex=0;p->stu_num=0;printf("继续录入请安1,退出请按2");scanf("%d",&n);}while(n==1);save();}voidsearch(){intn,i;chars[20];structA*p;load();do{printf("1按书名
5、查询2按作者查询3查询全部图书4退出");scanf("%d",&n);switch(n){case1:printf("请输入书名");scanf("%s",s);for(n=0,i=0,p=book;iname)==0){printf("书名:%s编号:%d单价:%d作者:%s状态:%d借书人:%s性别:%d学号:%d",p->name,p->num,p->price,p->author,p->state,p->bow_name,p->sex,p->stu_num);n++;}if(n==0)printf("无此书
6、记录");break;case2:printf("请输入作者");scanf("%s",s);for(n=0,i=0,p=book;iauthor)==0){printf("书名:%s编号:%d单价:%d作者:%s状态:%d借书人:%s性别:%d学号:%d",p->name,p->num,p->price,p->author,p->state,p->bow_name,p->sex,p->stu_num);n++;}if(n==0)printf("无此书记录");break;case3:for(i=0,p=book;i
7、num!=0)printf("书名:%s编号:%d单价:%d作者:%s状态:%d借书人:%s性别:%d学号:%d",p->name,p->num,p->price,p->author,p->state,p->bow_name,p->sex,p->stu_num);break;case4:break;}}while(n!=4);}voiddel(){chars[