思路
- 定义一个计算根据字数计算价格的函数
- 调用这和函数算本月短信费用
def price(x):
if x<=60:
return 0.1
else:
return 0.2
n=int(input())
li=[int(x) for x in input().split()]
print(sum([price(x) for x in li]))
def price(x):
if x<=60:
return 0.1
else:
return 0.2
n=int(input())
li=[int(x) for x in input().split()]
print(sum([price(x) for x in li]))