A company has the annual sales information. The sale price and the number of units sold are known for each product. The company wishes to process this information to obtain the list of products ordered by gross income. The gross income of a product is the amount generated by all sales of the product.
You MUST use the following struct definition to solve the problem:
struct Info{
string code;
int gross_income;
};
Exam score: 3.000000 Automatic part: 0.000000%
The input consists of zero or more cases. Each case consists of an integer followed by the information of products. The information of a product consists of a string that corresponds to the product identifier and two integers that respectively represent the sale price and the number of units sold.
For each case, the list ordered by gross income of the products as shown in the examples. In the case of a tie (when two products have generated the same gross income) will appear before the one that has a lower identifier. After each listing a blank line should be printed.
Author: Professorat Pro1
Generation: 2026-01-25T21:48:11.609Z
© Jutge.org, 2006–2026.
https://jutge.org