商店铅笔优惠销售标准:购买8支以内含每支售价08元超过8支部分每支售价07元。任意输入购买的铅笔总量n输出总金额。输入购买的铅笔总量n输出总金额样例输入 复制11样例输出 复制85python
n = int(input()) if n <= 8: price = n * 0.8 else: price = 8 * 0.8 + (n-8) * 0.7 print(price)
原文地址: http://www.cveoy.top/t/topic/hpK2 著作权归作者所有。请勿转载和采集!
安全问答是一个知识全球问答,包含丰富的问答知识
n = int(input()) if n <= 8: price = n * 0.8 else: price = 8 * 0.8 + (n-8) * 0.7 print(price)
原文地址: http://www.cveoy.top/t/topic/hpK2 著作权归作者所有。请勿转载和采集!