1011 World Cup Betting (20)(20 分)提问

With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best teams doing battles for the World Cup trophy in South Africa. Similarly, football betting fans were putting their money where their mouths were, by laying all manner of World Cup bets.

Chinese Football Lottery provided a "Triple Winning" game. The rule of winning was simple: first select any three of the games. Then for each selected game, bet on one of the three possible results -- namely W for win, T for tie, and L for lose. There was an odd assigned to each result. The winner's odd would be the product of the three odds times 65%.

For example, 3 games' odds are given as the following:

 W    T    L
1.1 2.5 1.7
1.2 3.0 1.6
4.1 1.2 1.1

To obtain the maximum profit, one must buy W for the 3rd game, T for the 2nd game, and T for the 1st game. If each bet takes 2 yuans, then the maximum profit would be (4.1*3.0*2.5*65%-1)*2 = 37.98 yuans (accurate up to 2 decimal places).

Input

Each input file contains one test case. Each case contains the betting information of 3 games. Each game occupies a line with three distinct odds corresponding to W, T and L.

Output

For each test case, print in one line the best bet of each game, and the maximum profit accurate up to 2 decimal places. The characters and the number must be separated by one space.

Sample Input

1.1 2.5 1.7
1.2 3.0 1.6
4.1 1.2 1.1

Sample Output

T T W 37.98
 #include<iostream>
#include<iomanip> using namespace std; int main()
{
double profit[][] = { }, max[] = { };
int index[] = { };
char result[] = {'W','T','L'}; for(int i=;i<;++i)
{
for(int j=;j<;++j)
{
cin>>profit[i][j]; if(profit[i][j] > max[i])
{
index[i] = j;
max[i] = profit[i][j];
}
}
} cout<<setprecision();
cout.setf(ios::fixed,ios::floatfield); cout<<result[index[]]<<" "<<result[index[]]<<" "<<result[index[]]<<" "
<< setprecision() << (max[]*max[]*max[]*0.65-)* << endl; return ;
}

PAT 甲级 1011 World Cup Betting (20)(20 分)的更多相关文章

  1. PAT 甲级 1011 World Cup Betting (20)(代码+思路)

    1011 World Cup Betting (20)(20 分) With the 2010 FIFA World Cup running, football fans the world over ...

  2. PAT 甲级 1011 World Cup Betting (20)(20 分)(水题,不用特别在乎精度)

    1011 World Cup Betting (20)(20 分) With the 2010 FIFA World Cup running, football fans the world over ...

  3. PAT甲级——1011 World Cup Betting

    PATA1011 World Cup Betting With the 2010 FIFA World Cup running, football fans the world over were b ...

  4. PAT 甲级 1011 World Cup Betting

    https://pintia.cn/problem-sets/994805342720868352/problems/994805504927186944 With the 2010 FIFA Wor ...

  5. pat 1011 World Cup Betting(20 分)

    1011 World Cup Betting(20 分) With the 2010 FIFA World Cup running, football fans the world over were ...

  6. 1011 World Cup Betting (20 分)

    1011 World Cup Betting (20 分) With the 2010 FIFA World Cup running, football fans the world over wer ...

  7. PAT甲 1011. World Cup Betting (20) 2016-09-09 23:06 18人阅读 评论(0) 收藏

    1011. World Cup Betting (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Wit ...

  8. PAT Advanced 1011 World Cup Betting (20 分)

    With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excite ...

  9. PAT甲级——A1011 World Cup Betting

    With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excite ...

随机推荐

  1. error: ld returned 1 exit status 解决

    1.程序未结束运行 2.全局变量冲突,不是宏定义冲突

  2. doc 常用命令

    ★ 查看java环境变量 echo %JAVA_HOME% echo %PATH% echo %CLASSPATH%

  3. <jsp:include>动作元素,附:最易出错的一点

    先定义一个date.jsp,再定义一个main.jsp.用<jsp:include plage = "相对url地址" flush = "true"> ...

  4. jsp中<%两个最容易搞混淆的用法,附:out.println与out.write的用法

    jsp中的<% java代码 %>,表示的是在html中写入java代码,其写入的格式就是在java代码的两头加上<% %>.搞明白这些以后,我们再来看看在js中,最易搞混淆的 ...

  5. torchvision库简介(翻译)

    部分跟新于:4.24日    torchvision 0.2.2.post3 torchvision是独立于pytorch的关于图像操作的一些方便工具库. torchvision的详细介绍在:http ...

  6. MySQL--派生表Condition Pushdown优化

    如果派生表外部过滤条件可以下推到派生表内部,可以有效减少派生表内部扫描数据量和派生表使用内存甚至避免使用派生表. 如对于下面查询: SELECT * FROM ( SELECT cluster_id, ...

  7. Singer 学习四 可视化数据操作工具

    knots 是一款基于electron 开发的可视化UI界面,我们可以此工具进行方便的数据处理,注意工具使用了 docker 运行,需要安装docker 下载地址   https://github.c ...

  8. Java各个知识点详解总结

    Java基础知识总结 写代码: 1,明确需求.我要做什么? 2,分析思路.我要怎么做?1,2,3. 3,确定步骤.每一个思路部分用到哪些语句,方法,和对象. 4,代码实现.用具体的java语言代码把思 ...

  9. kafka 中的术语

    出处:https://tech.meituan.com/2015/01/13/kafka-fs-design-theory.html table th:first-of-type { width: 7 ...

  10. java-常用注解

    JDK自带注解 @Override 重写, 标识覆盖它的父类的方法 @Deprecated   已过期,表示方法是不被建议使用的 @Suppvisewarnings 压制警告,抑制警告 元注解 @Ta ...