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. 乐在其中设计模式(C#) - 单例模式(Singleton Pattern)【转】

    介绍 保证一个类仅有一个实例,并提供一个访问它的全局访问点. 示例 保证一个类仅有一个实例. Singleton using System; using System.Collections.Gene ...

  2. JavaScript开发之路01(初识Sencha Touch框架)

    一.SenchaTouch的hello world实例: Ext.application({ name:'myapp', icon:'images/icon.png', glossOnIcon:fal ...

  3. oracle 设置标识列自增

    设置reg_user表 userid为自增列    1.设置键   2.创建序列   3.创建触发器

  4. IntelliJ IDEA使用之快捷键

    1. 自动完成代码 要完成代码 只需使用 Set<SSHConfig> sshConfigs = webConfig.getSshConfigs(); webConfig.getSshCo ...

  5. FZU 1686 神龙的难题 (DLX)

    神龙的难题 Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status ...

  6. AI 对不起 我还爱着你

    艾弗森,对不起,我还爱着你.有时候我自己都不知道自己我怎么了,直到最后才发现,我还爱着你. 那天起,我认识了你,便一发不可收拾.这些天,谢谢你,似乎因为你的影响让我改变了,坚持了许多.致以至今我才发现 ...

  7. Android 给应用定制皮肤

    Android 给应用定制皮肤 导读:皮肤也就是相关的资源文件单独放置在某个工程中,一种皮肤一个工程文件.一个工程包括N多的资源文件,多个工程间资源的关系是,文件名,资源ID等完全一样. 在实现程序功 ...

  8. Laravel 中查询 where 记录

    Laravel 的 Eloquent 使用 Between $query->whereBetween('age',[$from,$to]) 这是生成 And between ... and .. ...

  9. Android Support v4,v7,v13

    Android Support v4 是最早(2011年4月份)实现的库.用在Android1.6 (API lever 4)或者更高版本之上.它包含了相对V4, V13大的多的功能. 例如:Frag ...

  10. 【分享】.Net有哪些大型项目、大型网站的案例?

    .Net开发的部分知名网站案例:http://www.godaddy.com  全球最大域名注册商http://www.ips.com  环迅支付,国内最早的在线支付平台http://www.icbc ...