Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
73504 刘浩宇 单价最高的书 C++ Wrong Answer 1 MS 284 KB 605 2024-05-19 11:50:10

Tests(0/2):


Code:

#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; }


Run Info:

------Input------
3 1 Cinderella 12 120 2 Hoodwinked 10 150 3 Thumbelina 15 120
------Answer-----
2 Hoodwinked 10 150 15
------Your output-----
Book ID: 1, Title: Cinderella, Quantity: 12, Price: 120 Book ID: 2, Title: Hoodwinked, Quantity: 10, Price: 150 Book ID: 3, Title: Thumbelina, Quantity: 15, Price: 120