Run ID:73504
提交时间:2024-05-19 11:50:10
#include <iostream> #include <string> struct Book { int id; std::string title; int quantity; double price; }; int main() { int n; std::cin >> n; Book books[100]; for (int i = 0; i < n; ++i) { std::cin >> books[i].id >> books[i].title >> books[i].quantity >> books[i].price; } for (int i = 0; i < n; ++i) { std::cout << "Book ID: " << books[i].id << ", Title: " << books[i].title << ", Quantity: " << books[i].quantity << ", Price: " << books[i].price << "\n"; } return 0; }