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<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
int games[];
double odds[], p, maxp, ans;
char name[] = {'W', 'T', 'L'};
for(int i = ; i < ; i++){
maxp = -;
for(int j = ; j < ; j++){
scanf("%lf", &p);
if(p > maxp){
maxp = p;
odds[i] = p;
games[i] = j;
}
}
}
ans = (odds[] * odds[] * odds[] * 0.65 - 1.0) * 2.0 + 0.0005;
printf("%c %c %c %.2lf", name[games[]], name[games[]], name[games[]], ans);
cin >> p;
return ;
}

总结:

1、可以使用数组{'W,'T','L'}来记录结果。

2、四舍五入,可以加一个极小的数。

3、可以边输入边处理。

A1011. World Cup Betting的更多相关文章

  1. PAT甲级——A1011 World Cup Betting

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

  2. PAT A1011 World Cup Betting(20)

    AC代码 #include <cstdio> #include <algorithm> const int max_n = 3; using namespace std; /* ...

  3. 1011 World Cup Betting (20 分)

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

  4. PAT1011:World Cup Betting

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

  5. PAT 1011 World Cup Betting

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

  6. 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 ...

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

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

  8. PAT World Cup Betting[非常简单]

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

  9. 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 ...

随机推荐

  1. Day 4-9 subprocess模块

    我们经常需要通过Python去执行一条系统命令或脚本,系统的shell命令是独立于你的python进程之外的,每执行一条命令,就是发起一个新进程,通过python调用系统命令或脚本的模块在python ...

  2. 去掉dede织梦position当前位置最后一个箭头的方法

    理论是,dede的当前位置标签{dedefield name='position'}结构是 首页 > 主栏目 > 子栏目 > ,这就说明,而箭头符号字段数据都是在后台设置后存储在数据 ...

  3. python数据结构与算法第九天【选择排序】

    1.选择排序的原理 2.代码实现 def selection_sort(alist): n = len(alist) # 需要进行n-1次选择操作 for i in range(n-1): # 记录最 ...

  4. Map接口----Map中嵌套Map

    package cn.good.com; import java.util.HashMap; import java.util.Iterator; import java.util.Map; impo ...

  5. EChart.js 笔记一

    一直对数据可视化比较感兴趣,当年 Alibaba 年报晚会上的大屏显示可谓是技惊四座,够震撼,将数据之美展现得淋漓尽致. 国内的前端数据可视化插件中,echart.js 算是热度很高的,也容易上手,算 ...

  6. HttpRequest,WebRequest,HttpWebRequest,WebClient,HttpClient 之间的区别

    HttpRequest,WebRequest,HttpWebRequest,WebClient,HttpClient 今天我们来聊一下他们之间的关系与区别. HttpRequest 类 .NET Fr ...

  7. micro-fusion & macro-fusion

    micro-fusion 随着技术的发展,CPU内部指令处理单元(execution unit)以及端口(port)增多,在Pentium 4的时候,发出到Execution Unit的μops的th ...

  8. Python中数字之间的进制转换

    Python中的数据转换 在python中可以通过内置方法进行相应的进制转换,但需记得转化成非十进制时,都会将数字转化成字符串 转化成二进制 a = 10 #声明数字,默认十进制 b = bin(a) ...

  9. Ubuntu18.04安装RabbitMQ

    Ubuntu18.04安装RabbitMQ 2018年06月10日 19:32:38 dmfrm 阅读数:2492    版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog ...

  10. YUV格式与RGB格式

    YUV420介绍: YUV420格式是指,每个像素都保留一个Y(亮度)分量,而在水平方向上,不是每行都取U和V分量,而是一行只取U分量,则其接着一行就只取V分量,以此重复(即4:2:0, 4:0:2, ...