PATA1011 World Cup Betting

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 (4.1×3.1×2.5×65%−1)×2=39.31 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 W, T 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<cstdio>
#include<iostream>
#include<cmath>
using namespace std;

int main()
{
	double sum=1,m,temp=0.0;
	int t=0;
	char a[3]={'W','T','L'};
	for(int j=0;j<3;j++)
	{
		temp=0.0;
		for(int i=0;i<3;i++)
		{
			scanf("%lf",&m);
			if(temp<m)
			{
				temp = m;
				t=i;
			}
		}
		sum = temp*sum;
		cout<<a[t]<<" ";

	}
	printf("%0.2f",(sum*0.65-1.0)*2.0);
	return 0;
}

PAT甲级——1011 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

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

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

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

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

  7. PAT甲级——A1011 World Cup Betting

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

  8. PAT (Advanced Level) Practice 1011 World Cup Betting (20 分) 凌宸1642

    PAT (Advanced Level) Practice 1011 World Cup Betting (20 分) 凌宸1642 题目描述: With the 2010 FIFA World Cu ...

  9. PAT 1011 World Cup Betting

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

随机推荐

  1. 瑞士军刀DLib的VS2015编译

    Dlib的官方解释是: Dlib is a modern C++ toolkit containing machine learning algorithms and tools for creati ...

  2. Python笔记_第五篇_Python数据分析基础教程_相关安装和版本查看

    1. IDE说明: 所有的案例用Anacoda中的Jupiter工具进行交互式讲解. 2. 版本和安装: NumPy从如下网站安装:http://sourceforge.net/projects/nu ...

  3. DVWA--文件上传

    开门见山 1. 准备一个shell <?php echo shell_exec($_GET['cmd']);?> 2. 上传文件 3. 利用shell 4. Burp抓包,1是文件大小,2 ...

  4. centos rpm安装jdk1.8

    1.官网下载jdk的rpm文件(http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) ...

  5. SQL基础教程(第2版)第1章 数据库和SQL:练习题

    CREATE TABLE Addressbook ( regist_no INTEGER NOT NULL, name ) NOT NULL, address ) NOT NULL, tel_no ) ...

  6. PAT Advanced 1123 Is It a Complete AVL Tree (30) [AVL树]

    题目 An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child ...

  7. caffe-fasterrcnn程序理解

    faster-rcnn 结构杂谈  参考博客:::https://www.cnblogs.com/longriyao/p/5832274.html http://www.cnblogs.com/cha ...

  8. nginx常用编译参数

    ./configurate --prefix=/app/tengine --user=www --group=www --with-http_v2_module --with-http_ssl_mod ...

  9. winform程序常用图标网站及资源

    1.easyicon网站,免费下载 https://www.easyicon.net/ 2.findicons https://findicons.com/ 3.iconarchive http:// ...

  10. RedHat无法使用yum源问题

    RedHat下的yum是需要注册才能使用的 使用的话会提示: [root@test ~]# yum clean all Loaded plugins: product-id, refresh-pack ...