`
linest
  • 浏览: 150027 次
  • 性别: Icon_minigender_1
  • 来自: 内蒙古
社区版块
存档分类
最新评论

pat-1011 World Cup Betting

    博客分类:
  • pat
 
阅读更多
1011:
每行找最大值,相乘即可。

#include <iostream>
#include <vector>
using namespace std;

int main()
{
	double max;
	double res=1;
	double a,b,c;
	char type;

	for(int i=0;i<3;i++)
	{
		cin>>a;
		cin>>b;
		cin>>c;
		if(a>b)
		{
			max=a;
			type='W';
		}
		else
		{
			max=b;
			type='T';
		}

		if(c>max)
		{
			max=c;
			type='L';
		}

		printf("%c ",type);
		res*=max;
		
	}
	printf("%.2f",(res*0.65-1)*2);
}


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics