201809-1 卖菜(Python实现)
作者:
tmax | 来源:发表于
2019-11-20 18:11 被阅读0次n = int(input())
priceList = list( map(int, input().split()) )
newPriceList = priceList[:]
for i in range(n):
if i==0:
newPriceList[i] = int( (priceList[i] + priceList[i+1])/2 )
elif i==n-1:
newPriceList[i] = int( (priceList[i-1] + priceList[i])/2 )
else:
newPriceList[i] = int( (priceList[i-1] + priceList[i] + priceList[i+1] )/3 )
for ele in newPriceList:
print(ele, end=' ')
本文标题:201809-1 卖菜(Python实现)
本文链接:https://www.haomeiwen.com/subject/xpqaictx.html
网友评论