第三题轻轻松松
This commit is contained in:
@@ -10,3 +10,7 @@ add_executable(test2 test2.cpp
|
|||||||
LinkList.h
|
LinkList.h
|
||||||
LinkList.cpp
|
LinkList.cpp
|
||||||
)
|
)
|
||||||
|
add_executable(test3 test3.cpp
|
||||||
|
LinkList.h
|
||||||
|
LinkList.cpp
|
||||||
|
)
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user