【PAT】1011. World Cup Betting

来源:互联网 发布:商家如何联系淘宝客服 编辑:程序博客网 时间:2024/06/11 03:37
#include<iostream>#include<cmath>#include <cstdio>#include<algorithm>using namespace std;int main(){    double ans=1.0;    char S[3]={'W','T','L'};    char pos[4];    //输入时直接处理    for(int i=0;i<3;i++){        double temp=0.0;        for(int j=0;j<3;j++){            double a;            scanf("%lf",&a);            if(temp<a){                temp=a;                pos[i]=S[j];            }        }        ans*=temp;    }    printf("%c %c %c %.2f",pos[0],pos[1],pos[2],(ans*0.65-1)*2);    return 0;}

0 0
原创粉丝点击