World Cup Betting
对于要求小数点位数的问题还是乖乖用printf吧…
解答:
#include <iostream>
using namespace std;
int main() {
double Max = -1, a, res = 0.65;
int temp = -1;
char book[3] = { 'W','T','L' };
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
cin >> a;
if (a > Max) { Max = a; temp = j; }
}
cout << book[temp] << " ";
res *= Max;
Max = -1;
}
printf("%.2lf", (res - 1.) * 2.);
}