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. 将Vue移动端项目打包成手机app---HBuilder

    将移动端页面打包成app 1.使用 HBuilder 直接编译打包 点击左上角 文件>打开目录>选择目录  选择用Webpack打包好的dist文件目录 由于我添加到项目了,所以会显示该项 ...

  2. DNS_PROBE_FINISHED_NXDOMAIN & MacOS

    DNS_PROBE_FINISHED_NXDOMAIN 内网 DNS bug 8.8.8.8 8.8.4.4 # new inner Wi-Fi 10.1.3.10 10.1.3.13 Windows ...

  3. Git拉取项目时报错“remote: HTTP Basic: Access denied”解决方法

    问题: Git拉取项目时报错“remote: HTTP Basic: Access denied”,此问题多为本地密码与远端密码不符导致. 解决方法: 在下载地址中加上用户名和密码即可,如下: htt ...

  4. MVP, MVC, MVVM, 傻傻分不清楚~

    1 简介 英文原文:MVC vs. MVP vs. MVVM 三者的目的都是分离关注,使得UI更容易变换(从Winform变为Webform),使得UI更容易进行单元测试. 2 MVC/MVP 2.1 ...

  5. git reset 版本回退的三种用法总结

    git reset (–mixed) HEAD~1 回退一个版本,且会将暂存区的内容和本地已提交的内容全部恢复到未暂存的状态,不影响原来本地文件(未提交的也不受影响) git reset –soft ...

  6. c++ string去除首尾 空格、\n、\r、\t

    string s = " test "; size_t n = s.find_last_not_of(" \r\n\t"); if (n != string:: ...

  7. Asp.Net Core get client IP

    不废话,直接上代码,你懂得. public string GetRequestIP(bool tryUseXForwardHeader = true) { string ip = null; // t ...

  8. BizTalk Server 如何处理大消息

    什么是大消息? 遗憾的是,此问题的答案不而直接与特定的消息大小,绑定,取决于你的 Microsoft 的特定瓶颈 BizTalk Server 系统. 与大消息关联的问题可分为以下几类: 内存不足错误 ...

  9. 在js文件中通过jquery定位到某个dom时候设置事件时候 相当于直接在dom里面添加事件

    在js文件中通过jquery定位到某个dom时候设置事件时候 相当于直接在dom里面添加事件  当触发事件时候 会把当前的dom传给该方法

  10. poj-3080(kmp+暴力枚举)

    题意:给你多个字符串,问你这几个字符串的最长公共子串是哪个,如果有多个,输出字典序最大的那个,如果最长的公共子串长度小于3,输出一个奇怪的东西: 解题思路:首先看数据,数据不大,开始简单快乐的暴力之路 ...