第三题轻轻松松

This commit is contained in:
2024-10-19 15:47:56 +08:00
parent 28b3c3949d
commit cf8057ed6b
2 changed files with 25 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
//test3.cpp
#include <iostream>
#include"LinkList.h"
using namespace std;
void alter_to_110_percent(bookList &l) {
bookNode *temp = l->next;
while (temp != NULL) {
temp->price *= 1.1;
temp = temp->next;
}
}
int main() {
bookList books = new bookNode;
books->next = NULL;
create(books);
alter_to_110_percent(books);
display(&books);
return 0;
}