def sum_t(): n = int(input('请输入要求和的终止数:')) k = 2 l = 1 sum1 = k / l for i in range(1, n + 1): print(f'{k}/{l}') k, l = k + l, k sum1 += k / l print(sum1) sum_t()
def sum_t(): n = int(input('请输入要求和的终止数:')) k = 2 l = 1 sum1 = k / l for i in range(1, n + 1): print(f'{k}/{l}') k, l = k + l, k sum1 += k / l print(sum1) sum_t()