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 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<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define maxnum 100005 double shuzu[][]; int main(){ for(int i=;i < ;i++){
for(int j=;j < ;j++){
cin >> shuzu[i][j];
}
} double sum = 1.0;
for(int i=;i < ;i++){
map<double,char> mp;
mp[shuzu[i][]] = 'W';
mp[shuzu[i][]] = 'T';
mp[shuzu[i][]] = 'L';
double t = max(shuzu[i][],max(shuzu[i][],shuzu[i][]));
sum*=t;
cout << mp[t] << " ";
}
sum = (sum*0.65-)*;
printf("%.2lf",sum); return ;
}

傻逼题写了半个小时,还是一开始没想明白就上手写了,结果写的时候一直再改。

还有要熟悉结构化编程,每次实现一个功能可以先试一下正确不正确。

 

PAT 1011 World Cup Betting的更多相关文章

  1. pat 1011 World Cup Betting(20 分)

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

  2. PAT 1011 World Cup Betting 查找元素

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

  3. PAT 1011 World Cup Betting (20分) 比较大小难度级别

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

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

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

  6. PAT 甲级 1011 World Cup Betting (20)(代码+思路)

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

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

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

  9. 1011 World Cup Betting (20 分)

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

随机推荐

  1. Twenty score

    1.上图中有两个人对读书的看法有较大的不同. There are two people in the cartoon who treat books in completely different w ...

  2. Hexo搭建(VPS)

    都说 hexo 是静态的 Blog,当时不明觉厉= =.后来终于知道了什么意思......所谓的静态,其实就是因为你不能改云端,而是依赖本地数据,然后使用命令将本地数据变成 web 数据再使用浏览器进 ...

  3. 关于页面的跳转添加参数(比如id啥的)

    最近一些新手老是问我一些关于页面之间的传递跳转,怎么带参数这件事,(比如说一个列表页到详情页面数据是怎么传输的),今个没事就在这说一些! 这里拿列表页面到详情页面来阐述下哈! 首先在列表页,我们通过a ...

  4. 前端单页面富应用(SPA)的实现

    一. 什么是单页面富应用? 单页面应用:Single Page Application 概念:Web应用即使不刷新也在不同的页面间切换,解决浏览器前进.后退等机制被破坏等问题.并且页面访问会被浏览器保 ...

  5. Codeforces 776E The Holmes Children

    题目链接:http://codeforces.com/problemset/problem/776/E ${\because gcd(i,n-i)=1\Leftrightarrow gcd(i,n)= ...

  6. JSON parse error: Cannot deserialize instance of `int` out of START_OBJECT token; nested exception is com.fasterxml.jackson.databind.exc

    代码程序: @PostMapping("selectById") @ResponseBody public Result selectById(@RequestBody int i ...

  7. sql 中常见的控制流语句

    控制流语句:1 begin .....end  2 if ...else  例如:if exists (select * from 表名称 ) begin selct * from  表名称 end  ...

  8. Windows下pipenv将虚环境文件的位置设置在项目根目录下

    在windows下使用pipenv shell时,虚拟环境文件夹会在C:\Users\Administrator\.virtualenvs\目录下默认创建,为了方便管理,将这个虚环境的文件的位置更改一 ...

  9. Rxbus的使用

    Rxbus是一种模式,在RxJava中 一.添加依赖 compile 'io.reactivex:rxandroid:1.2.0' compile 'io.reactivex:rxjava:1.1.5 ...

  10. gc调优我们到底在调整什么

    java开发一般都会涉及到jvm调优其中gc调优是个重点项.那gc调优调整的究竟是什么呢准确来说是业务.下面围绕这个话题展开 起因 为什么说是业务呢得从cc++开始说起如果说是用c/c++做开发运行的 ...