题目描述
简单模拟,写一下就好了
C++ 代码
#include <iostream>
#include <unordered_map>
using namespace std;
double m[3][3];
int main()
{
unordered_map<int, char> q;
q[0] = 'W', q[1] = 'T', q[2] = 'L';
for (int i = 0; i < 3; i ++)
for (int j = 0; j < 3; j ++)
cin >> m[i][j];
double total = 1;
for (int i = 0; i < 3; i ++)
{
int idx = 0;
double maxn = -1;
for (int j = 0; j < 3; j ++)
if (m[i][j] > maxn)
maxn = m[i][j], idx = j;
total *= maxn;
cout << q[idx] << " ";
}
printf("%.2lf", (total * 0.65 - 1) * 2);
}