把输入函数修好了

This commit is contained in:
2024-10-19 00:48:14 +08:00
parent 39819cdf5e
commit f675daad41
3 changed files with 26 additions and 13 deletions
+1 -12
View File
@@ -2,22 +2,11 @@
#include "LinkList.h"
using namespace std;
void insert(bookList &l) {
bookNode *temp = l;
while (temp != NULL) {
cin >> (*temp).id >> (*temp).name >> (*temp).price;
if (!(((*temp).id == "0" && (*temp).name == "0" && (*temp).price == 0))) {
temp = (*temp).next = new bookNode;
} else {
temp = NULL;
}
}
}
int main() {
bookList books = new bookNode;
books->next = NULL;
insert(books);
create(books);
display(&books);
return 0;
}