Code:
#include<bits/stdc++.h>
using namespace std;
int c,d,e,r,b,m=-1;
int main()
{
cin>>r>>b>>c>>d>>e;
m=max(m,r*c+b*d);
if(r>b)
{
swap(r,b);
swap(c,d);
}
m=max(m,r*e*2+(b-r)*d);
cout<<m;
}
WA on #2 and #8,找不出问题,求助
是不是 m=max(m,r*e*2+(b-r)*d); 这个语句有问题?