PAT甲级 1011 World Cup Betting (20 分)

直接选大小

 

#include
#define FI first
#define SE second

using namespace std;
typedef long long ll;
const ll maxn = 1e8 + 7;


double a1, a2, a3;
double b1, b2, b3;
double c1, c2, c3;
double ans;
void solve(double a, double b, double c) {
    if(a >= b && a >= c) {
        ans *= a;
        printf("W");
        return;
    }
    if(b >= a && b >= c) {
        ans *= b;
        printf("T");
        return;
    }
    if(c >= b && c >= a) {
        ans *= c;
        printf("L");
        return;
    }
}
int main() {
    scanf("%lf%lf%lf", &a1, &a2, &a3);
    scanf("%lf%lf%lf", &b1, &b2, &b3);
    scanf("%lf%lf%lf", &c1, &c2, &c3);
    ans = 1.0;
    solve(a1, a2, a3); printf(" ");
    solve(b1, b2, b3); printf(" ");
    solve(c1, c2, c3); printf(" ");
    ans = (ans * 0.65 - 1) * 2;
    printf("%.2f", ans);
    return 0;
}

 

你可能感兴趣的:(PAT甲级)