其他分享
首页 > 其他分享> > PAT 甲级 A1011 (2019/02/01)

PAT 甲级 A1011 (2019/02/01)

作者:互联网

#include<cstdio>
int main(){
    double a, b, c, MAX, product = 1.0;
    char WTL[3];
    for(int i = 0; i < 3; i++){
        scanf("%lf %lf %lf", &a, &b, &c);
        MAX = a > b ? a : b;
        MAX = c> MAX ? c : MAX;
        MAX == a ? WTL[i] = 'W' : MAX == b ? WTL[i] = 'T' : WTL[i] = 'L'; 
        product *= MAX;
        printf("%c ", WTL[i]);  
    }
    printf("%.2f", (product*0.65-1)*2);
    return 0;
}

标签:02,lf,product,01,PAT,int,MAX,printf,WTL
来源: https://www.cnblogs.com/zjsaipplp/p/10428014.html