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<stdio.h>
int main(){
double w, t, l;
double maxProfit = 1;
int i;
for(i = 0; i < 3; i++){
scanf("%lf%lf%lf", &w,&t,&l);
if(w > t && w >l)
{
printf("W ");
maxProfit *= w;
}
else if(t>l){
printf("T ");
maxProfit *= t;
}
else {
printf("L ");
maxProfit *= l;
}
}
printf("%.2f\n",(maxProfit*0.65-1)*2);
//printf("%.2f\n",(maxProfit*0.65-1)*2 +0.005);
return 0;
}
NOTES:
感觉这道题目有点问题,例子是错的,
分享到:
相关推荐
1.1 2.5 1.7 1.2 3.1 1.6 4.1 1.2 1.1
football_betting.zip
Profitable Betting Systems for Horseracing
资源分类:Python库 所属语言:Python 资源全名:betting_models-0.1.3-py3-none-any.whl 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
Part VI Taking Research to the Real World Chapter 17: The Devil in HML’s Details 467 Clifford Asness and Andrea Frazzini Chapter 18: Fact, Fiction, and Momentum Investing 495 Clifford Asness, Andrea ...
NFL_Betting_Data
world Blockchain projects using Ethereum. With interesting real-world projects, you will know learn how to write smart contracts which run exactly as programmed without any chance of fraud, censorship...
git clone cd betting-app 运行npm start 在没有 Node.js 和 NPM 的情况下运行 git clone cd betting-app/app 单击 index.html 并使用任何浏览器打开 当这是第一次时,此命令将在启动 Web 服务器之前安装所需的...
以太坊坚实度-React投注 以太坊坚实度--React-Betting-App.git
world Blockchain projects using Ethereum. With interesting real-world projects, you will know learn how to write smart contracts which run exactly as programmed without any chance of fraud, censorship...
NFL_Betting_Data
cs_betting_assistant
Fantasy_Betting
Betting_WebApplication:投注WebApp
深度学习需要通过调节大量算法参数来获得最好的结果;其中就包括学习率的人为调节;该文档使用了coinbet算法,令学习率不需要再人为的设置
betting 使用 React 和 Redux 制作的竞猜游戏,主题为2018年世界杯,支持 PC 、移动端和微信。不需服务器支持,所有游戏逻辑均在前端完成,。 调试源码 $ apt-get install nodejs npm $ npm install $ npm run watch...
这是Aseco的插件(永远的Trackmania程序)! 它可以在Aseco 2.x上运行。 这个插件的目的是提供一个允许下注的机器人。 如果成功,您将获得一些荣誉
该软件用于保存“帐户”的加密记录,以便在任何类型的游戏(例如纸牌)中用假钱下注。它具有复利功能,帐户持有人的余额每天按1%的比例进行复利。 它管理游戏期间进行的下注。
该项目是通过引导的。 您将在下面找到一些有关如何执行常见任务的信息。 您可以在找到本指南的最新版本。 目录 自动格式化代码 更改页面<title> 安装依赖项 导入组件 代码分割 添加样式表 ...met