PAT 1011 world cup betting 翻译 分析 代码

#include<cstdio>
int main(){
	int i,j,wtf[5];
	char tit[3]={'W','T','L'};
	double ans=1.0,b,temp;
	for(i=0;i<3;i++)
	{
		temp=-1;
		for(j=1;j<4;j++){
			scanf("%lf",&b);
			if(b>temp){temp=b;wtf[i]=j;
			}
		}

		ans*=temp;

	}
	for(i=0;i<3;i++) 	printf("%c ",tit[wtf[i]-1]);
	printf("%.2f",(ans*0.65-1)*2);
	return 0;
}

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

我回来了,即日每天两至多更。

而她却走了,带走了我全部的心与思绪。

愿你前程似锦。 我不会轻易放弃。

猜你喜欢

转载自blog.csdn.net/qq_42319613/article/details/81115004
今日推荐