fix: book array first var is 0

This commit is contained in:
2024-09-26 12:59:00 +08:00
parent aee105ec51
commit 056803f467
+1 -1
View File
@@ -49,7 +49,7 @@ void input(book *books, int n) {
void output(book_and_number *books_and_number) {
cout << books_and_number->number_of_books << endl;
for (int i = 0; i < books_and_number->number_of_books; i++) {
for (int i = 1; i < books_and_number->number_of_books + 1; i++) {
cout << books_and_number->books[i].id << " " << books_and_number->books[i].name << " " << fixed <<
setprecision(2) <<
books_and_number->books[i].price << endl;