以下是使用 Python 语言解决此问题的代码: ```python weight, option = input().split() weight = int(weight) base_fee = 8 if weight > 1000: extra_weight = (weight - 1000) extra_fee = (extra_weight // 500 + (1 if extra_weight % 500!= 0 else 0)) * 4 else: extra_fee = 0 if option == 'y': total_fee = base_fee + extra_fee + 5 else: total_fee = base_fee + extra_fee print(total_fee) ``` [2024-11-08 09:50:20 | AI写代码神器 | 155点数解答]