L1-068 调和平均 python
python实现
num=int(input()) s=input() sum=0.0 for i in range(num): f=1.0/float(s.split(" ")[i]) sum+=f sum=1.0/(sum/float(num)) print("{:.2f}".format(sum))
python实现
num=int(input()) s=input() sum=0.0 for i in range(num): f=1.0/float(s.split(" ")[i]) sum+=f sum=1.0/(sum/float(num)) print("{:.2f}".format(sum))