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

题目意思是寻找每一行三个数中最大的数,然后三个数代入下面的公式计算得到最终结果,结果保留两位有效数字
这题的样例有问题应该是37.97
#include<iostream>
#include<cstring>
#include<string>
#include<algorithm>
#include<cmath>
#include<queue>
#include<map>
#include<vector>
#include<stack>
#include<map>
#define inf 0x3f3f3f3f
#define ll long long
using namespace std;
int main()
{
char a[];
double b[];
for(int i=;i<=;i++)
{
double x,y,z;
cin>>x>>y>>z;
double c=max(x,max(y,z));
b[i]=c;
if(c==x)
a[i]='W';
else if(c==y)
a[i]='T';
else if(c==z)
a[i]='L';
}
for(int i=;i<=;i++)
cout<<a[i]<<" ";
printf("%.2lf",(b[]*b[]*b[]*0.65-)*);
return ; }

PAT 甲级 1011 World Cup Betting (20)(20 分)(水题,不用特别在乎精度)的更多相关文章

  1. PAT 甲级 1011 World Cup Betting (20)(20 分)

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

  2. PAT 甲级 1011 World Cup Betting (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. 【问题解决:未找到端口号】启动报错Circular placeholder reference 'server.port' in property definitions

    问题描述: 启动spring boot项目时报错:Circular placeholder reference 'server.port' in property definitions 解决过程: ...

  2. Gym - 100712D Alternating Strings

    http://codeforces.com/gym/100712/attachments 题意: 给出一个01串,现在要切割这个01串,使得每个子串长度都不大于k,并且每个子串不能01交替出现,单个字 ...

  3. POJ 2115 C Looooops(模线性方程)

    http://poj.org/problem?id=2115 题意: 给你一个变量,变量初始值a,终止值b,每循环一遍加c,问一共循环几遍终止,结果mod2^k.如果无法终止则输出FOREVER. 思 ...

  4. c++ 反转容器的元素顺序(reverse)

    #include <vector> #include <iostream> #include <iterator> #include <algorithm&g ...

  5. 3个方法实现JavaScript判断移动端及pc端访问不同的网站

    3个方法比较简单,分别在页面头部加入如下js代码: 对于简单地直接从www.maslinkcom跳转到m.maslink.com,此方法仅从首页而言: <script>(function ...

  6. domain---Node.js 异步异常的处理与domain模块解析

    var domain = require('domain'); app.use(function (req, res, next) { var reqDomain = domain.create(); ...

  7. 关于UDP很好的书籍和文章(整理、持续更新)

    文章 告知你不为人知的 UDP:疑难杂症和使用(必看)

  8. 第10章 Pry, 强大的pry-rails和相关的几个好用gem

    https://asciinema.org/a/0KtCL9HB1bP08wNHLfIeOMa8K 本章讲了如何定位❌,和排除bug. Pry  (5000

  9. UI测试_错题解析

    解析:因为jQuery easyUI是基于jQuery框架在使用之前应该先引入jquery框架否则jQuery easyUI将失效,故D错误 解析:考Link标签和script标签的区别,Link引入 ...

  10. MyBatis Generator去掉生成的注解

    是不是很讨厌mybatis Generator帮我们生成代码的时候在Mapper和mapper.xml文件中生成的一大堆注解?今天在看MyBatis Generator代码的时候发现,原来mybati ...