price = input("价格列表").split(",") incomes = [] def max_income(price): for i in range(len(price)): buy = -price[i] for j in range(i + 1, len(price)): sell = price[j] incomes.append(buy + sell) return max(incomes) max_income(price)
1 2

相关推荐

点赞 评论 收藏
分享
牛客网
牛客企业服务