试着写了个链表.cpp

This commit is contained in:
2024-10-18 23:54:54 +08:00
parent 2db5c5ae58
commit 10b6e6aa67
3 changed files with 59 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
#include <iostream>
#include "LinkLits.cpp"
using namespace std;
void insert(bookList *l) {
bookNode *temp = (*l)->next;
while (temp != NULL) {
cin >> (*temp).id >> (*temp).name >> (*temp).price;
if (!(((*temp).id == "" && (*temp).name == "" && (*temp).price == 0))) {
temp = (*temp).next;
} else {
temp = NULL;
}
}
}
int main() {
bookList books = new bookNode;
books->next = NULL;
insert(&books);
display(&books);
return 0;
}