1011 World Cup Betting (20 分)

本文介绍了2010年FIFA世界杯期间的足球彩票游戏——“Triple Winning”,玩家需要从三场比赛中选择并预测赢、平、输的结果,每种结果都有对应的赔率。赢家的赔率是三个最高赔率的乘积再乘以65%。提供的代码展示了如何计算赔率和预测结果。

1011 World Cup Betting (20 分)

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 for win, for tie, and for lose. There was an odd assigned to each result. The winner’s odd would be the product of the three odds times 65%.W ``T ``L

For example, 3 games’ odds are given as the following:在这里插入图片描述


#include<bits/stdc++.h>
using namespace std;
int main()
{
	double w,t,l,p=1;
	char a[3];
	for(int i=0;i<3;i++)
    {
		scanf("%lf %lf %lf",&w,&t,&l);
        double m = max(max(w,t),l);
		p=p*m;
		if(m==w)    a[i]='W';
		if(m==t)    a[i]='T';
		if(m==l)    a[i]='L';
	}
	printf("%c %c %c %.2lf",a[0],a[1],a[2],(p*0.65-1)*2);
	return 0;
}

代码不算难,就是找出里面的最大值,W是win ,T是tie ,L是lose

在这里插入图片描述

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值