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.1 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 ( yuans (accurate up to 2 decimal places).

Input Specification:

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 WT and L.

Output Specification:

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.1 1.6
4.1 1.2 1.1

Sample Output:

T T W 39.31
 #include <iostream>
using namespace std;
//我只能说是弱智题,找到每场必赛的最大赔率就行
int main()
{
double a, b, c, p[];
char res[];
for (int i = ; i < ; ++i)
{
cin >> a >> b >> c;
if (a > b && a > c)
{
p[i] = a;
res[i] = 'W'; }
else if (b > a && b > c)
{
p[i] = b;
res[i] = 'T';
}
else
{
p[i] = c;
res[i] = 'L';
}
}
a = 1.0;
for (int i = ; i < ; ++i)
{
cout << res[i] << " ";
a *= p[i];
}
printf("%.2f\n", (a * 0.65 - ) * + 0.0000005);//由于double存在精度问题,所以加一位
return ;
}

PAT甲级——A1011 World Cup Betting的更多相关文章

  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 (20)(20 分)(水题,不用特别在乎精度)

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

  4. PAT甲级——1011 World Cup Betting

    PATA1011 World Cup Betting With the 2010 FIFA World Cup running, football fans the world over were b ...

  5. PAT 甲级 1011 World Cup Betting

    https://pintia.cn/problem-sets/994805342720868352/problems/994805504927186944 With the 2010 FIFA Wor ...

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

  7. PAT A1011 World Cup Betting(20)

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

  8. A1011. World Cup Betting

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

  9. PAT Advanced 1011 World Cup Betting (20 分)

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

随机推荐

  1. 实用的 atom 插件

    推荐几款我喜欢的Atom插件 时间 2017-05-05 09:00:00  Hi Linux 原文  http://www.hi-linux.com/posts/28459.html 主题 Atom ...

  2. Git的忽略提交规则

    相关知识参考资料: https://git-scm.com/book/zh/v2/Git-基础-记录��% 8F%E6%AC%A1%E6%9B%B4%E6%96%B0%E5%88%B0%E4%BB%9 ...

  3. POJ-3264-Balanced Lineup-线段树模板题-查询区间内最大值和最小值之差

    For the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always line up in the same order. One d ...

  4. Caused by: java.lang.NoSuchMethodError: org.hibernate.engine.spi.SessionFactoryImplementor.getProperties()Ljava/util/Properties;

    报错信息 Error starting ApplicationContext. To display the auto-configuration report re-run your applica ...

  5. a标签 href触发及传值

    var d=document.getElementById("exportA");alert(d.href);d.href="${ctx}/templet/tEdasTe ...

  6. 第八篇:ZTree操作总结

    花了一个多星期,终于完成了这个完整的功能,今天周五是时候总结下加深理解了. 项目要实现的功能:将树形目录发布到发布库,若是根目录,没有发布,连同自己和下面所有的子目录们全部发布:不是根目录,判断父目录 ...

  7. 王者归来,Java 程序设计葵花宝典!

    致谢  感谢所有关注本号的小伙伴们,这一年来本号的茁壮成长离不开大家的支持. 2018年,继续坚持分享以及为大家谋求福利!!! Java技术栈往期赠书 赠书一:新春第一次送书,价值78元 X 3本 赠 ...

  8. <jquery>基本的模态框

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  9. scull 的内存使用

    scull 使用的内存区, 也称为一个设备, 长度可变. 你写的越多, 它增长越多; 通过使用 一个短文件覆盖设备来进行修整. scull 驱动引入 2 个核心函数来管理 Linux 内核中的内存. ...

  10. mysql commond record

    CREATE DATABASE IF NOT EXISTS codex_gm DEFAULT CHARACTER SET utf8; service mysqld stop screen -dmS m ...