问题描述:给定三场比赛和每一场的结果的赔率,问怎么下注使利润最大,
解题思路:每一场都选最大的。
AC代码:
#include<iostream>
using namespace std;
double max(double a,double b){
return a>b?a:b;
}
int main()
{
double w,t,l,p=1;
int i;
char c[3];
for(i=0;i<3;i++){
scanf("%lf %lf %lf",&w,&t,&l);
double m=max(max(w,t),l);
p=p*m;
if(m==w)c[i]='W';
if(m==t)c[i]='T';
if(m==l)c[i]='L';
}
printf("%c %c %c %.2lf",c[0],c[1],c[2],(p*0.65-1)*2);
return 0;
}