#include<iostream>
#include<stdio.h>
#include<string>
using namespace std;
int main()
{
double num[3][3];
int i,j;
for(i=0;i<3;++i)
{
for(j=0;j<3;++j)
cin>>num[i][j];
}
int flag;
double max,result=1;
for(i=0;i<3;++i)
{
max=-1;
flag=0;
for(j=0;j<3;++j) //找到每场比赛的盈利最大值
{
if(max<num[i][j])
{
max=num[i][j];
flag=j;
}
}
result=result*num[i][flag];
if(flag==0) //输出对每场比赛的选择
cout<<"W ";
else if(flag==1)
cout<<"T ";
else
cout<<"L ";
}
result=(result*0.65-1)*2;
printf("%.2lf\n",result);
return 0;
}
PAT (Advanced Level) Practise 1011 World Cup Betting (20)
最新推荐文章于 2017-12-17 10:42:03 发布