第4章-8 求分数序列前N项和 a, b = 1, 2 n = int(input()) res = 0 for i in range(n): res += b / a a, b = b, a + b print('{:.2f}'.format(res))