题解 | #累加数与平均值#
累加数与平均值
https://www.nowcoder.com/practice/ed009465ad6940609542ef5879a0d697
lst=[]
x=0
y=0
a=input().split()
for i in a:
lst.append(int(i))
for i in lst:
x+=i
y+=1
z=x/y
print(x,"{:.1f}".format(z),end="\n")
累加数与平均值
https://www.nowcoder.com/practice/ed009465ad6940609542ef5879a0d697
lst=[]
x=0
y=0
a=input().split()
for i in a:
lst.append(int(i))
for i in lst:
x+=i
y+=1
z=x/y
print(x,"{:.1f}".format(z),end="\n")
相关推荐
查看12道真题和解析