1102 教超冠军卷
#include <iostream>
using namespace std;
struct paper
{
string ID;
int price;
int Purchases;
long long int products;
};
int main()
{
int N;
cin >> N;
paper p[N];
for (int i = 0; i < N; i++)
{
cin >> p[i].ID >> p[i].price >> p[i].Purchases;
p[i].products = p[i].price * p[i].Purchases;
}
paper maxPorchases = p[0];
paper maxProducts = p[0];
for (int i = 0; i < N; i++)
{
if (maxPorchases.Purchases < p[i].Purchases)
maxPorchases = p[i];
if (maxProducts.products < p[i].products)
maxProducts=p[i];
}
cout<<maxPorchases.ID<<" "<<maxPorchases.Purchases<<"\n";
cout<<maxProducts.ID<<" "<<maxProducts.products;
}