AcWing 1483. 世界杯投注
原题链接
简单
作者:
eveer
,
2021-08-26 20:27:37
,
所有人可见
,
阅读 168
#include<bits/stdc++.h>
using namespace std;
float choose(float w,float t,float l)
{
float res=w;
int loc=1;//记录最大值的下标
if(t>res)
{
res=t;
loc=2;
}
if(l>res)
{
res=l;
loc=3;
}
if(loc==1)cout<<'W'<<' ';
else if(loc==2)cout<<'T'<<' ';
else cout<<'L'<<' ';
return res;
}
int main()
{
float res=1;
for(int i=0;i<3;i++)
{
float w,t,l;//w,t,l分别表示赢、平、输的值
scanf("%f%f%f",&w,&t,&l);
float mid=choose(w,t,l);
res*=mid;
}
res=(res*0.65-1)*2;
printf("%.2f",res);
return 0;
}