From 7b0874026d0a6ccf8ac32459149aa1a4e92239fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=A1=E5=9D=82=E6=98=B4?= Date: Thu, 26 Sep 2024 12:10:53 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BE=93=E5=87=BA=E7=94=A8=E7=A9=BA=E6=A0=BC?= =?UTF-8?q?=E5=88=86=E9=9A=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- homework1/test1.cpp | 2 +- homework1/test2.cpp | 2 +- homework1/test3.cpp | 2 +- homework1/test4.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/homework1/test1.cpp b/homework1/test1.cpp index e4b4d3e..f41f3ae 100644 --- a/homework1/test1.cpp +++ b/homework1/test1.cpp @@ -21,7 +21,7 @@ int input(book *books) { void output(book *books, int length) { for (int i = 0; i < length; i++) { - cout << books[i].id << "\t" << books[i].name << "\t" << fixed << setprecision(2) << books[i].price << endl; + cout << books[i].id << " " << books[i].name << " " << fixed << setprecision(2) << books[i].price << endl; } } diff --git a/homework1/test2.cpp b/homework1/test2.cpp index 12ec9c1..c56cd33 100644 --- a/homework1/test2.cpp +++ b/homework1/test2.cpp @@ -37,7 +37,7 @@ int input(book *books) { void output(book *books, int length) { for (int i = 0; i < length; i++) { - cout << books[i].id << "\t" << books[i].name << "\t" << fixed << setprecision(2) << books[i].price << endl; + cout << books[i].id << " " << books[i].name << " " << fixed << setprecision(2) << books[i].price << endl; } } diff --git a/homework1/test3.cpp b/homework1/test3.cpp index 0b52054..2effad1 100644 --- a/homework1/test3.cpp +++ b/homework1/test3.cpp @@ -27,7 +27,7 @@ int input(book *books) { void output(book *books, int length) { for (int i = 0; i < length; i++) { - cout << books[i].id << "\t" << books[i].name << "\t" << fixed << setprecision(2) << books[i].price << endl; + cout << books[i].id << " " << books[i].name << " " << fixed << setprecision(2) << books[i].price << endl; } } diff --git a/homework1/test4.cpp b/homework1/test4.cpp index 9542a52..babaa37 100644 --- a/homework1/test4.cpp +++ b/homework1/test4.cpp @@ -47,7 +47,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++) { - cout << books_and_number.books[i].id << "\t" << books_and_number.books[i].name << "\t" << fixed << + cout << books_and_number.books[i].id << " " << books_and_number.books[i].name << " " << fixed << setprecision(2) << books_and_number.books[i].price << endl; }