PAT 1011. 世界杯投注
原题链接
简单
作者:
YAX_AC
,
2024-11-25 20:18:48
,
所有人可见
,
阅读 2
//Lottery彩票 Triple三倍的 bet on赌 assigned to分配给
//bet on one of the three possible results 押注于三种可能的结果之一
//There was an odd assigned to each result.每个结果都有一个奇数。
//To obtain the maximum profit, one must buy W for the 3rd game, T for the 2nd game, and T for the 1st game.
//为了获得最大的利润,必须为第三场比赛购买W,为第二场比赛购买T,为第一场比赛购买T。
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
const int N = 1010;
double a[N],b[N],c[N];
void f(int x)
{
if(x==1) cout<<"W ";
else if(x==2) cout<<"T ";
else cout<<"L ";
}
int main()
{
double maxs1 = 0,maxs2 = 0,maxs3 = 0;
int t1,t2,t3;
for(int i = 1; i<=3; i++)
{
cin>>a[i];
if(a[i]>maxs1)
{
maxs1 = a[i];
t1 = i;
}
}
for(int i = 1; i<=3; i++)
{
cin>>b[i];
if(b[i]>maxs2)
{
maxs2 = b[i];
t2 = i;
}
}
for(int i = 1; i<=3; i++)
{
cin>>c[i];
if(c[i]>maxs3)
{
maxs3 = c[i];
t3 = i;
}
}
f(t1),f(t2),f(t3);
double ans = (maxs1*maxs2*maxs3*0.65-1)*2;
printf("%.2lf",ans);
return 0;
}