solution
找出最大的销售数量和销售额,并记录对应的ID
#include<iostream>
#include<string>
using namespace std;
int main(){
int n, cnt = -1, money = -1, price, person;
string s, a, b;
cin >> n;
while(n--){
cin >> s >> price >> person;
if(person > cnt){
cnt = person;
a = s;
}
if(person * price > money){
money = person * price;
b = s;
}
}
cout << a << " " << cnt << endl << b << " " << money;
return 0;
}