题意:
题目意思不难理解,不过要注意一下赢,输,平的赔率是不可能相等的。这样还顺便不用考虑其他的情况。
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
double triple[][] = new double[3][3];
double odd = 1;
for(int i=0; i<3; i++) {
double maxOdd = Double.MIN_VALUE;
int maxOddIndex = -1;
for(int j=0; j<3; j++) {
triple[i][j] = input.nextDouble();
if(triple[i][j] > maxOdd) {
maxOdd = triple[i][j];
maxOddIndex = j;
}
}
if(maxOddIndex == 0) System.out.print("W ");
else if(maxOddIndex == 1) System.out.print("T ");
else System.out.print("L ");
odd *= maxOdd;
}
System.out.printf("%.2f", 2*(odd*0.65-1));
input.close();
}
}