damage = 0 total_bottles = 500 * 6 for i in range(1, total_bottles + 1): if i % 10 == 0: damage += 1 else: continue total_cost = total_bottles // 10 * 5 if damage > 0: total_cost -= damage * 10 net_profit = 1332 - total_cost print('损坏暖瓶的个数为:', damage) print('净利润为:', net_profit)

Python 编程计算运输损坏暖瓶数量

原文地址: https://www.cveoy.top/t/topic/nPho 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录