`
风吹过PP好冷
  • 浏览: 36671 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

PAT1011 World Cup Betting

    博客分类:
  • PAT
 
阅读更多

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 <iomanip>
#include <string>
using namespace std;

int main()
{
	int N = 3;
	float total = 1;
	string str;
	while (N--)
	{
		float x,y,z;
		cin>>x>>y>>z;
		float Max = max(max(x,y),z);
		if (Max == x)
		{
			str += "W ";
		}
		else if (Max == y)
		{
			str += "T ";
		}
		else
		{
			str += "L ";
		}
		total *= Max;
	}
	cout.setf(ios::fixed);
	float Result = (total * 0.65 - 1)*2;
	cout<<str<<setprecision(2)<<Result;
	return 0;
}
 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics