【数据结构】图书馆图书借阅信息管理系统 下载本文

}

p2=p1;

p1=p1->next; } break; case 2:printf(\请输入要进行修改的作者的名字:\ scanf(\ while(p1!=NULL) {

if(strcmp(linshi.auther,p1->auther)==0) {

printf(\请输入要修改之后的作者:\\n\ scanf(\ break; }

p2=p1;

p1=p1->next; } break; case 3:printf(\请输入要进行修改的书的出版社:\ scanf(\ while(p1!=NULL) {

if(strcmp(linshi.chubanshe,p1->chubanshe)==0) {

printf(\请输入要修改之后的出版社:\\n\ scanf(\ break; }

p2=p1;

p1=p1->next; } break; case 4:printf(\请输入要进行修改的书的价格:\ scanf(\ while(p1!=NULL) {

if(linshi.price==p1->price) {

printf(\请输入要修改之后的出版社:\\n\ scanf(\ break; }

p2=p1;

p1=p1->next; } break; case 5:printf(\请输入要进行修改的书的编号:\ scanf(\ while(p1!=NULL) {

if(linshi.booknumber==p1->booknumber) {

printf(\请输入要修改之后的出版社:\\n\ scanf(\ break; }

p2=p1;

p1=p1->next; } break; case 6:printf(\请输入要进行修改的书的状态:\ scanf(\ while(p1!=NULL) {

if(linshi.onof==p1->onof) {

printf(\请输入要修改之后的状态:\\n\ scanf(\ break; }

p2=p1;

p1=p1->next; } break; default:printf(\ } p1=p2=a; while(p1!=NULL) {

fwrite(p1,sizeof(struct book),1,pbook3); p2=p1;

p1=p1->next; }

fclose(pbook3); return 0; }

int Delete(BookPtr a) //删除图书信息 {

system(\ jiemian(); BOOK b;

BookPtr p1,p2; p1=p2=a; int flag=0;

printf(\请选择要删除的图书的书名:\ scanf(\ while(p1!=NULL) {

if(strcmp(b.bookname,p1->bookname)==0) {

if(p1==a) {

a=p1->next; free(p1); } else {

p2->next=p1->next; free(p1); }

break; } else {

p2=p1;

p1=p1->next; } }

Save(a); }

int Save(BookPtr a) //将处理好的链表存入文件 {

FILE * pbook3; BookPtr p1,p2; p1=p2=a; if((pbook3=fopen(\ {

printf(\不能打开文件!!!\ }

while(p1!=NULL) {

fwrite(p1,sizeof(struct book),1,pbook3); p2=p1;

p1=p1->next; }

fclose(pbook3); return 0; }

int show_function1_window(UserPtr1 b) {

jiemian();

BookPtr p1,p2; p1=p2=bookhead; int m; do {

system(\ jiemian();

printf(\尊敬的%s用户,您好!\ printf(\查询服务\ printf(\借书服务\ printf(\还书服务\ printf(\还清欠款\

printf(\显示所有图书信息\ printf(\选择0退出登录!!!\ printf(\请选择您需要的服务:\\n\ scanf(\ switch(m) {

case 1:Serch(bookhead); system(\ break;

case 2:Jieshu(bookhead); break;

case 3:Huanshu(bookhead); break; case 4:Huankuan(); break;

case 5:Show(bookhead); break; case 0:break;

default:printf(\

//用户主界面