#include "stdlib.h"
#include "conio.h"
#include "stdio.h"
#include "windows.h"
struct bookinfo
{
char booknum [10];
char ISBN[20];
char publisher[40];
struct bookinfo*next;
};
struct bookinfo *createHead()
{
struct bookinfo *headNode;
headNode=(struct bookinfo*)malloc(sizeof(struct bookinfo));
headNode->next=NULL;
return headNode;
};
struct bookinfo* createNode(struct bookinfo data)
{
struct bookinfo *newNode;
newNode=(struct bookinfo*)malloc(sizeof(struct bookinfo));
newNode->next=NULL;
return newNode;
};
void insertNode(struct bookinfo*headNode,struct bookinfo data)
{
struct bookinfo *newNode=createNode(data);
//先连后断
newNode->next=headNode->next;
headNode->next=newNode;
};
void printList(struct bookinfo*headNode,struct bookinfo data)
{
struct bookinfo *pmove=headNode->next;
while(pmove!=NULL)
{
printf("%s\t%s\t%s\n",pmove->booknum,pmove->ISBN,pmove->publisher);
pmove=pmove->next;
}
}
void menu();
void menumanager();
void menureader();
void readermmenu();
void insertNode();
void printList();
int main(struct bookinfo data)
{ int flag;
struct bookinfo*tempbook;
struct bookinfo*list;
list=createNode(data);
menu();
printf("请选择操作方式\n");
scanf("%d",&flag);
while(flag==1)
{
int a;
menumanager();
printf(" 请选择操作选项\n");
scanf("%d",&a);
switch(a)
{
case 0:
exit(0);
case 1:
system("cls");
printf("请输入图书编号\n");
scanf("%s",tempbook->booknum);
printf("请输入图书ISBN码\n");
scanf("%s",tempbook->ISBN);
printf("请输入出版社\n");
scanf("%s",tempbook->publisher);
insertNode(list,tempbook);
break;
case 4:
printfList(list);
break;
default:
break;
}
}
}
void menu()
{
system("cls");
printf("\n\n\n");
printf(" -------------------------欢迎使用图书借还信息管理系统-------------------------\n");
printf(" | |\n");
printf(" | 请选择登录方式 |\n");
printf(" | 1.管理员 |\n");
printf(" | 2.读者 |\n");
printf(" | |\n");
printf(" ------------------------------------------------------------------------------\n");
}
void menumanager()
{ //管理员菜单
system("cls");
printf("\n\n\n");
printf(" ┌──────────────────欢迎使用图书借还信息管理系统--管理员────────────────────┐ \n");
printf(" │ │ \n");
printf(" │ 请选择操作项目: │ \n");
printf(" │ 1.录入图书信息 2.修改图书信息 │ \n");
printf(" │ 3.删除图书信息 4.查询图书信息 │ \n");
printf(" │ 5.借阅图书 6.归还图书 │ \n");
printf(" │ 7.管理员信息管理 8.借阅证管理 │ \n");
printf(" │ 0.退出系统 │ \n");
printf(" └──────────────────────────────────────────────────────────────────────────┘ \n");
}
void readermmenu()
{ //管理读者信息菜单
system("cls");
printf("\n\n\n");
printf(" ┌──────────欢迎使用图书借还信息管理系统--管理员────────────┐ \n");
printf(" │ │ \n");
printf(" │ 请选择操作项目: │ \n");
printf(" │ 1.录入读者信息 2.修改读者信息 │ \n");
printf(" │ 3.删除读者信息 4.查询读者信息 │ \n");
printf(" │ 5.统计读者借阅信息 6.返回上一级菜单 │ \n");
printf(" └──────────────────────────────────────────────────────────┘ \n");
}
void menureader()
{ //读者菜单
system("cls");
printf("\n\n\n");
printf(" ┌───────────欢迎使用图书借还信息管理系统--读者─────────────┐ \n");
printf(" │ │ \n");
printf(" │ 请选择操作项目: │ \n");
printf(" │ 1.查询图书信息 2.查询借还书信息 │ \n");
printf(" │ 3.修改个人信息 0.退出系统 │ \n");
printf(" └──────────────────────────────────────────────────────────┘ \n");
}
问题在哪呢?,应该怎么改