阶梯电价

#阶梯电价
e=float(input())
cost=0
if e<0:
print("Invalid Value!")
elif e<=50:
cost=e*0.53
print("cost = {0:.2f}".format(cost))
else:
cost=50*0.53+(e-50)*0.58
print("cost = {0:.2f}".format(cost))

 

posted @ 2025-01-02 20:38  Grit_Doyle  阅读(9)  评论(0)    收藏  举报