身首异处
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
#include <iostream>
|
||||
#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);
|
||||
display(&books);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user