第29001题 单选题
请选出可以正确实现指定简易模拟功能的Python代码片段

需求为:模拟简易购物总价计算,首先输入商品单价和购买数量,计算总金额;若总金额达到或超过100元,则减免10元后输出最终金额;否则直接输出总金额。

A
price = float(input("请输入商品单价:"))
count = int(input("请输入购买数量:"))
total = price * count
if total >= 100:
    total -= 10
print("最终总金额:", total)
B
price = float(input("请输入商品单价:"))
count = int(input("请输入购买数量:"))
total = price * count
if total > 100:
    total -= 10
print("最终总金额:", total)
C
price = float(input("请输入商品单价:"))
count = int(input("请输入购买数量:"))
total = price + count
if total >= 100:
    total -= 10
print("最终总金额:", total)
D
price = float(input("请输入商品单价:"))
count = int(input("请输入购买数量:"))
total = price * count
if total >= 100:
    total += 10
print("最终总金额:", total)
程序运行统计
暂无判题统计
提交0次 正确率0.00%
答案解析