您的位置:首页 > 其它

【PAT】甲级1011 - World Cup Betting(水)

2017-07-20 15:42 501 查看
题目链接:点击打开题目



这道题本来是没什么可贴博客的,就是读题那个65%那一点不知道什么意思,但是按照给的例子跑了一遍,并没有什么问题,还是水题。

代码如下:

#include<queue>
#include<cmath>
#include<stack>
#include<cstdio>
#include<vector>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long LL;
#define INF 0x3f3f3f3f
#define CLR(a,b) memset(a,b,sizeof(a))
#define PI acos(-1.0)
double W,T,L;
double choose()
{
if (W > T && W > L)
{
cout << "W ";
return W;
}
else if (T > W && T > L)
{
cout << "T ";
return T;
}
else
{
cout << "L ";
return L;
}
}
int main()
{
double ans = 1.0;
for (int i = 1 ; i <= 3 ; i++)
{
cin >> W >> T >> L;
ans *= choose();
}
ans = (ans*0.65-1)*2.0;
printf ("%.2lf\n",ans);
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: