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

这题的IO例子纯坑爹! 例子里面输出百分位是四舍五入的,我一开始没注意,后来很高兴的注意到了,把它四舍五入了,然后就怎么都WA了。

最后试着把  +0.005 去掉,竟然AC了

AC代码:

 #include <iostream>

 #include <iomanip>

 #include <string>

 using namespace std;

 double a[][];

 int main()

 {

     while(cin>>a[][])

       {

             cin>>a[][]>>a[][];

             int i,j;

           for(i=;i<=;i++)

                   for(j=;j<=;j++)

                         cin>>a[i][j];

             double max[]={,,};

             string   cc[];

             for(i=;i<=;i++)

             {

                   int temp;

                   for(j=;j<=;j++)

                   {

                   if(a[i][j]>max[i])

                         {

                               max[i]=a[i][j];

                               temp=j;

                         }

                   }

             if(temp==) 

                   {

                         cc[i]="W";

                   }

                   if(temp==) cc[i]="T";

                   if(temp==) cc[i]="L";

             }

             for(i=;i<=;i++)

                   cout<<cc[i]<<" ";

             double sum=1.0;

             for(i=;i<=;i++)

                   sum=sum*max[i];

                   sum=sum*0.65;

         sum=(sum-)*;

             cout<<fixed<<setprecision()<<sum<<endl;

       }

       return ;

 }

1011. World Cup Betting (20)(最大值)的更多相关文章

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

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

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

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

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

  5. PATA 1011 World Cup Betting (20)

    1011. World Cup Betting (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Wit ...

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

  7. 1011 World Cup Betting (20)(20 point(s))

    problem With the 2010 FIFA World Cup running, football fans the world over were becoming increasingl ...

  8. PAT (Advanced Level) Practice 1011 World Cup Betting (20 分) (找最值)

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

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

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

随机推荐

  1. cocos2d-x lua 使用http(下载图片, POST JSON)

    cocos2d-x lua 使用http(下载图片, POST JSON) version: cocos2d-x 3.6 1.使用http post json与服务器交互 require(" ...

  2. Python刷票小脚本——网络人气奖?不好意思,我要了

    零.前言 最近参加微软的kinect大赛,报名之后发现有一个网络投票,票数最多的项目可以得到网络人气奖. 这种事,必然是要搞一搞! 说干就干. 说明:由于本人过于懒惰,所以就不截图了,让大家失望了! ...

  3. Guava: 事件总线EventBus

    EventBus 直译过来就是事件总线,它使用发布订阅模式支持组件之间的通信,不需要显式地注册回调,比观察者模式更灵活,可用于替换Java中传统的事件监听模式,EventBus的作用就是解耦,它不是通 ...

  4. 转:android git开源项目列表

    1. 知乎的合集说明 https://www.zhihu.com/question/19804692 2. http://p.codekk.com/

  5. Sharepoint 列表

    1.将SharePoint 2010列表数据使用Access打开 在SharePoint 2010新增加了对列表在Access客户端的打开,可以在Microsoft Access 中处理列表中的项目, ...

  6. 做一个聪明的.net程序员

    最近看了传智播客(http://net.itcast.cn/)的.net培训视频,感受颇深,忍不住要把感受写下来跟网友分享一下. 我从接触.net到现在已经至少过去了三五个年头,用.net也已经做了若 ...

  7. android手机操作SD的使用方法

    写入SD卡 package com.example.openfileproject; import java.io.File; import java.io.FileInputStream; impo ...

  8. Sql传参含有单引号

    程序 exec heduling_date_select ' Name like @%a%@ or phone like @%a%@ or Cus_code like @%a%@ or objjc l ...

  9. PHP学习笔记 - 入门篇(5)

    PHP学习笔记 - 入门篇(5) 语言结构语句 顺序结构 eg: <?php $shoesPrice = 49; //鞋子单价 $shoesNum = 1; //鞋子数量 $shoesMoney ...

  10. NSArray的Category

    NSArray的Category 前言 项目中自己通过各种渠道及结合项目的经验整理了一套自己的工具包,里面有各种Category,及封装的方法,方便项目使用,今天先分享一下NSarray的Catego ...