输出用空格分隔
This commit is contained in:
+1
-1
@@ -21,7 +21,7 @@ int input(book *books) {
|
|||||||
|
|
||||||
void output(book *books, int length) {
|
void output(book *books, int length) {
|
||||||
for (int i = 0; i < length; i++) {
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -37,7 +37,7 @@ int input(book *books) {
|
|||||||
|
|
||||||
void output(book *books, int length) {
|
void output(book *books, int length) {
|
||||||
for (int i = 0; i < length; i++) {
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -27,7 +27,7 @@ int input(book *books) {
|
|||||||
|
|
||||||
void output(book *books, int length) {
|
void output(book *books, int length) {
|
||||||
for (int i = 0; i < length; i++) {
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -47,7 +47,7 @@ void input(book *books, int n) {
|
|||||||
void output(book_and_number books_and_number) {
|
void output(book_and_number books_and_number) {
|
||||||
cout << books_and_number.number_of_books << endl;
|
cout << books_and_number.number_of_books << endl;
|
||||||
for (int i = 0; i < books_and_number.number_of_books; i++) {
|
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) <<
|
setprecision(2) <<
|
||||||
books_and_number.books[i].price << endl;
|
books_and_number.books[i].price << endl;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user