博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
1011. World Cup Betting (20)
阅读量:6916 次
发布时间:2019-06-27

本文共 2036 字,大约阅读时间需要 6 分钟。

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
char sign[3]={
'W','T','L'};void Display(double a[],double *s);int main(){ double result=1,data[3][3]; int i; for(i=0;i<3;i++)scanf("%lf %lf %lf",&data[i][0],&data[i][1],&data[i][2]); for(i=0;i<3;i++)Display(data[i],&result); printf("%.2lf",(result*0.65-1)*2); //printf("%.2lf",(result*0.65-1)*2+0.00001);}void Display(double a[],double *s){ double k; int i; if(a[0]>a[1]){k=a[0];i=0;} else {k=a[1];i=1;} if(a[2]>k){k=a[2];i=2;} printf("%c ",sign[i]); (*s)*=k;}

转载于:https://www.cnblogs.com/xLester/p/5902210.html

你可能感兴趣的文章
英特尔推出全新RRP物联网平台 计划为零售技术投资一亿美元
查看>>
中关村创业大街联合英特尔共建开放创新实验室
查看>>
Vega数据可视化工具——教你轻松玩转大数据可视化 | 附代码
查看>>
企业网络:安全只能靠两招
查看>>
中国CRM企业“学习”Salesforce,只是在集体自嗨?
查看>>
驱动智能制造的大数据时代
查看>>
智能家居独角兽将在传统企业中诞生
查看>>
IT仍是美国最佳就业岗位:人才稀缺令科技公司很着急
查看>>
Linux恶意软件将树莓派设备变成“矿工”
查看>>
拥抱开放式网络 通往下一代数据中心
查看>>
为了防止客户的丢失,请客服人员禁止做的四件事
查看>>
39人被骗147万 大麦网遭撞库带来的警醒
查看>>
SDN重塑企业网络 网络管理者的角色转变
查看>>
NGINX发布新版本,旨在解决应用程序安全性
查看>>
在SSH中增加JUNIT4单元测试
查看>>
阿里巴巴物联网战略软硬通吃 不做产品做生态
查看>>
柳传志:市场不理解联想控股 不会减持联想集团
查看>>
从雷军提案看涂鸦硬件智能化升级方案v2.0
查看>>
移动化办公:Saas的3种困境和新的模式
查看>>
Test Case所涵盖的范围足够了吗?
查看>>