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. 两道不错的递推dp

    hdoj-4055 #include <cstdio> #include <cstring> #include <iostream> #include <al ...

  2. MySQL数据库-外键链表之一对多,多对多

    外键链表之一对多 外键链表:就是a表通过外键连接b表的主键,建立链表关系,需要注意的是a表外键字段类型,必须与要关联的b表的主键字段类型一致,否则无法创建索引 一对多:就是b表的某一个字段值对应a表外 ...

  3. 编译Spring源码

    近期,学习Spring源码.会陆续记录这次学习历程. Spring源码下载,环境中需要准备好的东西,git,gradle,eclipse (需要自己安装好) 1.Git clone Spring源码: ...

  4. Android 播放内部mp3音乐

    private void heartSound() { try { AssetManager am = getAssets();//获得该应用的AssetManager AssetFileDescri ...

  5. ThinkPHP 5.2 出 RC1 版本 RC 是什么意思呢?

    ThinkPHP 5.2 出 RC1 版本 RC 是什么意思呢? RC 的意思是软件候选版本,就是不会有很大的改变,主要还是在除错方面. 来自收集的资料1引用: Alpha:是内部测试版,一般不向外部 ...

  6. pip查看已安装包列表

    输入命令: pip freeze 结果: certifi==2018.10.15chardet==3.0.4Django==2.1.2idna==2.7pytz==2018.5requests==2. ...

  7. chmod修改权限

    1.命令简介 chmod(Change mode) 用来将每个文件的模式更改为指定值.Linux/Unix 的档案调用权限分为三级 : 档案拥有者.群组.其他. u :目录或者文件的当前的用户 g : ...

  8. BeanShell用法(摘抄至网络)

    说明:本文部分资料摘抄至 来源: http://www.cnblogs.com/puresoul/p/4915350.html 来源: http://www.cnblogs.com/puresoul/ ...

  9. centos服务器上部署javaweb项目(转)

    本文总体参照http://blog.csdn.net/u011019141(然后更据自己情况进行更改) 一.安装JDK 1.首先要查看服务器的系统版本,是32位还是64位 #getconf LONG_ ...

  10. [VC6] 小谈如何解决VC6.0 open崩溃的问题(已解决)(转)

    [昨天重装了系统,开始用VC6还是可以的,后来装了WPS,在用VC6里面的Open就崩溃了. 这个解决方法就这么几步:1.把FileTool.dll放到指定的AddIns目录.2. 注册这个dll到注 ...