商场周末大优惠,购物满100元享9折优惠,帮小明算算最终要付多少钱?

小明和妈妈在商场购物,享受满100元打9折的优惠,你能帮他们算算最终要付多少钱吗?

输入格式

第一行一个整数N,表示所买物品的个数。

第二行N个整数,数字间用空格隔开,表示N件物品要付的元数。

输出格式

最终的应付款。(保留两位小数)

样例组

输入#1 5 10 20 30 10 5 输出#1 75.00

输入#2 8 10 20 30 40 50 60 70 80 输出#2 334.00

提示说明

n = int(input())
a = list(map(int, input().split()))
total = sum(a)
if total > 100:
    total = 100 + (total - 100) * 0.9
print('%.2f' % total)
商场周末大优惠,购物满100元享9折优惠,帮小明算算最终要付多少钱?

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

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