PAT 甲级【1011 World Cup Betting】

发布时间 2023-10-24 16:26:11作者: fishcanfly
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StreamTokenizer;

public class Main {
    @SuppressWarnings("unchecked")
    public static void main(String[] args) throws IOException {
        StreamTokenizer in = new StreamTokenizer(new InputStreamReader(System.in));
        double ans = 1.0f;
        char[] arr = new char[3];
        for (int i = 0; i < 3; i++) {
            double max = 0.0f;
            char ch = 'W';
            for (int j = 0; j < 3; j++) {
                in.nextToken();
                double v = in.nval;
                if (v > max) {
                    max = v;
                    if (j == 0) {
                        ch = 'W';
                    } else if (j == 1) {
                        ch = 'T';
                    } else {
                        ch = 'L';
                    }
                }
            }
            arr[i] = ch;
            ans *= max;
        }
        System.out.println(arr[0]+" "+arr[1]+" "+arr[2]+" "+String.format("%.2f",(ans*0.65-1.0f)*2));

    }
}