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. lesson4Embedding-fastai

    dense layer:mnist识别中,需要十组dense权重矩阵来计算这十个输出内容,conv矩阵每一个元素乘以另一个矩阵的元素并相加,得到一个值,最后加上sigmoid(softmax在二元情况 ...

  2. currentStyle&getComputedStyle获取属性

    方法如下: function getStyle(obj,attr){ if(obj.currentStyle){ return obj.currentStyle[attr]; // IE 中的方法 } ...

  3. day 0150面向对象-成员

    一 类的成员 在类中定义的变量和方法都被称为成员 class Person: def __init__(self, name, num, gender, birthday): # 成员变量(实例变量) ...

  4. visual studio + opencv + contrib

    经过一天的奋战,终把opencv给用起来了.我是用的工具是vs2017+opencv3.3 上午想用mingw+opencv,结果查了很多资料说gcc不支持opencv.我感觉很奇怪,支不支持以后再说 ...

  5. AangularJS入门总结二

    双向数据绑定:在Mode(JS)中改变数据,而这些变动立刻就会自动出现在View上,反之亦然.一方面可以做到model变化驱动了DOM中元素变化,另一方面也可以做到DOM元素的变化也会影响到Model ...

  6. Object Relational Mapping(ORM)

    Object Relational Mapping(ORM) ORM介绍 ORM概念 对象关系映射(Object Relational Mapping,简称ORM)模式是一种为了解决面向对象与关系数据 ...

  7. MySQL使用游标

    MySQL检所操作返回一组称为结果集的行,游标是一个存储在MySQL服务器上的数据库查询,它不是一条select语句,而是被该语句所检索出来的结果集.只能用于存出过程. 声明(定义)游标,这个过程没有 ...

  8. What is the difference between concurrency, parallelism and asynchronous methods?

    Ref: http://stackoverflow.com/questions/4844637/what-is-the-difference-between-concurrency-paralleli ...

  9. HBase源码分析之WAL

    WAL(Write-Ahead Logging)是数据库系统中保障原子性和持久性的技术,通过使用WAL可以将数据的随机写入变为顺序写入,可以提高数据写入的性能.在hbase中写入数据时,会将数据写入内 ...

  10. spring boot 学习资料

    spring boot 学习资料: 学习资料 网址 Spring Boot Cookbook-极客学院 http://wiki.jikexueyuan.com/project/spring-boot- ...