题解 | 中彩票的的概率

中彩票的的概率

https://www.nowcoder.com/practice/531e409e1b564cfbbb275c6a8d3a4b45

numbers = list(map(int,input().split()))
probabilities = list(map(float,input().split()))
bought_numbers = list(map(int,input().split()))

prod_dict = dict(zip(numbers,probabilities))

winning_prod = 1

for number in bought_numbers:
    winning_prod *= prod_dict[number]

print(f"{winning_prod:.3f}")

全部评论

相关推荐

12-28 09:59
复旦大学 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务