← 返回题库
初级

World Cup Betting

未完成
初级参考 完整示例代码供参考,建议自己理解后重新输入
def solve(l1, l2, l3):
    best = []
    total = 0.65
    for line in [str(l1), str(l2), str(l3)]:
        w = list(map(float, line.split()))
        idx = w.index(max(w))
        best.append(('W', 'T', 'L')[idx])
        total *= max(w)
    print(' '.join(best))
    print(f'{total:.2f}')

示例

输入
solve('3.0 3.0 3.0', '3.0 3.0 3.0', '3.0 3.0 3.0')
期望输出
W W W
17.55
Python 代码 🔒 登录后使用
🔒

登录后即可练习

注册免费账号,在浏览器中直接运行 Python 代码