【PAT甲级题解记录】1011 World Cup Betting (20 分)
前言
Problem:1011 World Cup Betting (20 分)
Difficulty:剧情模式
想流点汗想流点血死而无憾Address:1011 World Cup Betting (20 分)
问题描述
分别给定3场比赛不同结果的赔率,问怎么买能到达最大可能收益。
这题题目有点长,看不懂单词可能都不知道在讲什么,但是根据样例能大概想出来,所以根据题意直接写就行了,甚至连个坑都没有。
参考代码
/*
* @Author: Retr0.Wu
* @Date: 2022-02-16 00:29:57
* @Last Modified by: Retr0.Wu
* @Last Modified time: 2022-02-16 00:32:54
*/
#include <bits/stdc++.h>
using namespace std;
int main()
{
double ans = 1;
for (int i = 1; i <= 3; i++)
{
if (i > 1)
cout << " ";
double o1, o2, o3;
cin >> o1 >> o2 >> o3;
if (o1 > o2 && o1 > o3)
{
cout << "W";
}
else if (o2 > o1 && o2 > o3)
{
cout << "T";
}
else
{
cout << "L";
}
ans *= max(o1, max(o2, o3));
}
cout << fixed << setprecision(2) << " " << (ans * 0.65 - 1) * 2;
return 0;
}