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"iostream"
#include "algorithm"
#include<iomanip>//注意关于小数数位的头文件
using namespace std;

int main()
{
float a[3][3];
int b[3],t=0,temp;
float max,sum=1;
for(int i=0;i<3;i++)
{
max=0;
for(int j=0;j<3;j++)
{
cin >> a[i][j];
if(max<=a[i][j])
{
max = a[i][j];
temp = j;
}
}
b[t++]=temp;
sum *=max;
}
for(int j=0;j<t;j++)
{
if(b[j]==0)
cout<<"W"<<" ";
else if(b[j]==1)
cout<<"T"<<" ";
else
cout<<"L"<<" ";
}
cout<<setiosflags(ios::fixed);//如果为cout<<setiosflags(ios::fixed)<<cout.precision(2);则会输出一个6
cout.precision(2);//设置小数点后为两位
cout<<((sum*0.65-1)*2)<<endl;

return 0;
}

浙大pat 1011题解的更多相关文章

  1. 浙大pat 1035题解

    1035. Password (20) 时间限制 400 ms 内存限制 32000 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue To prepare f ...

  2. 浙大pat 1025题解

    1025. PAT Ranking (25) 时间限制 200 ms 内存限制 32000 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Programmi ...

  3. 浙大PAT 7-06 题解

    #include <stdio.h> #include <iostream> #include <algorithm> #include <math.h> ...

  4. 浙大pat 1012题解

    1012. The Best Rank (25) 时间限制 400 ms 内存限制 32000 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue To eval ...

  5. 浙大 pat 1003 题解

    1003. Emergency (25) 时间限制 400 ms 内存限制 32000 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue As an emerg ...

  6. 浙大 pat 1038 题解

    1038. Recover the Smallest Number (30) 时间限制 400 ms 内存限制 32000 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHE ...

  7. 浙大 pat 1047题解

    1047. Student List for Course (25) 时间限制 400 ms 内存限制 64000 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Y ...

  8. 浙大pat 1054 题解

    1054. The Dominant Color (20) 时间限制 100 ms 内存限制 32000 kB 代码长度限制 16000 B 判题程序 Standard Behind the scen ...

  9. 浙大pat 1059 题解

    1059. Prime Factors (25) 时间限制 50 ms 内存限制 32000 kB 代码长度限制 16000 B 判题程序 Standard 作者 HE, Qinming Given ...

随机推荐

  1. ubuntu16.04 samba 配置

    samba是一个很有用的在Linux和Windows之间共享文件的服务器程序,在工作的时候一直在使用,不过都是别人配置好的环境,自已一直没有配置过Samba服务器,今天尝试着自己配置的一次遇到了很多的 ...

  2. Time.timeScale、游戏暂停

    原文链接 项目里面一直在用Time.timeScale来做游戏的 1倍 2倍整体加速,今天我仔细看了一下Time.timeScale才发现之前我理解错了一些东西. Time.timeScale可以控制 ...

  3. 多微博账号同时发微博的插件--fawave

    我们每个人应该都不止一个博客或者微博,尤其是明星.为了考虑与新闻社区媒体的关系,必须在每个平台都要入住一下才好,还有一方面也是对粉丝的一种关爱吧.反正里面关系很复杂.有没有一个工具可以讲微博的内容同步 ...

  4. [SOJ]Easy sort (归并排序)

    Description You know sorting is very important. And this easy problem is: Given you an array with N ...

  5. Latex 使用小技巧

    Latex引用多篇参考文献 连续引用参考文献时中间中破折号连起来:[1,2,3,4]—>[1-4] 这是只需要在文档开始加入下面语句命令: \usepackage[numbers,sort&am ...

  6. Unity灯光详解

    Lights will bring personality and flavor to your game. You use lights to illuminate the scenes and o ...

  7. Everything(速度快的文件搜索软件) 1.4.1.801b 汉化绿色版

    软件名称: Everything(速度快的文件搜索软件) 软件语言: 简体中文 授权方式: 免费软件 运行环境: Win7 / Vista / Win2003 / WinXP 软件大小: 2.0MB ...

  8. Python学习笔记——进阶篇【第九周】———协程

    协程 协程,又称微线程,纤程.英文名Coroutine.一句话说明什么是协程:协程是一种用户态的轻量级线程. 协程拥有自己的寄存器上下文和栈.协程调度切换时,将寄存器上下文和栈保存到其他地方,在切回来 ...

  9. [河南省ACM省赛-第四届] 表达式求值(nyoj 305)

    栈的模拟应用: #include<iostream> #include<cstdio> #include<cstring> #include<string&g ...

  10. 各种ps特效的网址

    粉笔字效果:http://www.jb51.net/photoshop/280740.html