题解 | 网购

网购

https://www.nowcoder.com/practice/5d7dfd405e5f4e4fbfdff6862c46b751

num_list = list(map(str, input().split()))

def compute(price, month, day, couple):
    price = float(price)
    if int(month) == 11 and int(day) == 11:
        price *= 0.7
    elif int(month) == 12 and int(day) == 12:
        price *= 0.8
    else:
        price = price
    
    if int(couple) == 1:
        price -= 50
    
    if price <= 0:
        price = 0

    return price

price = compute(num_list[0], num_list[1], num_list[2], num_list[3])
print(f"{price:.2f}")



全部评论

相关推荐

03-03 19:02
已编辑
东华理工大学 Node.js
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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