40分求助
查看原帖
40分求助
542047
EC75楼主2021/12/6 20:27
def P1089():
    cost_list = []
    for month in range(12):
        cost_list.append(int(input().strip()))
    left_money = 0
    mom_money = 0
    for pos, cost in enumerate(cost_list):
        left_money = left_money + 300 - cost
        if left_money < 0:
            print(-(pos + 1))
            return
        else:
            mom_money += int(left_money / 100) * 100
            left_money = left_money % 100
    print(mom_money * 1.2 + left_money)
P1089()
2021/12/6 20:27
加载中...