题解 | #牛牛学数列2#
牛牛学数列2
https://www.nowcoder.com/practice/fc72951f52984f3abd286d82eeffacba
n=int(input()) sum=0 if n==0: print(0) else: for i in range(1,n+1): sum+=1/i sum=sum print(f"{sum:.6f}")
牛牛学数列2
https://www.nowcoder.com/practice/fc72951f52984f3abd286d82eeffacba
n=int(input()) sum=0 if n==0: print(0) else: for i in range(1,n+1): sum+=1/i sum=sum print(f"{sum:.6f}")
相关推荐