基于链式存储结构的图书信息表的图书去重
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<iomanip>
//#pragma warning(disable:)
using namespace std;
struct information {
char booknum[20];
char bookname[20];
float price = 0.0f;
};
typedef struct LNode {
information data;
LNode *next;
}*Linklist;
void Create(Linklist &L, int *num) {
int n = *num;
L = new LNode;
Linklist p, r;
p = new LNode;
L->next = p;
cout << "请输入图书信息" << endl;
while (n) {
cin >> p->data.booknum >> p->data.bookname >> p->data.price;
r = p;
p = new LNode;
r->next = p;
n--;
}
p->next = NULL;
}
void repeatdelete(Linklist &L,int *newnum) {
Linklist p = new LNode;
p = L->next;
Linklist u = p, r = new LNode, fore = L;
while (u->data.price) {
u = p->next;
while (u->data.price) {
if (strcmp