/*图书信息管理系统,要求用单链表
完成查找、插入、删除、修改、排序、计数功能*/
#include<stdio.h>
#include<iostream.h>
#include<malloc.h>
#include<cstdlib>//包含exit头文件
#include<math.h>
#include<string.h>
#define MAXSIZE 100
#define OK 1
#define ERROR 0
typedef int Status;
typedef struct
{
char no[20];//图书ISBN
char name[50];//名字
float price;//价格
}Book;
typedef struct LNode
{
Book data;
struct LNode *next;
}LNode,*LinkList
Status InitList(LinkList &L)
{
//初始化
L=(LNode *)malloc(sizeof(LNode));
if(!L) exit(0);//分配失败
L->next=NULL;//一定要将指针域置空
return OK;
}
Status MakeList(LinkList &L)
{
//text test
LNode *p;
p=L;
cout<<"ISBN、名前、价格くれ"<<endl;
for(
图书信息管理系统(链表)
最新推荐文章于 2024-04-03 10:00:00 发布