题解 | #等差数列#
等差数列
https://www.nowcoder.com/practice/f792cb014ed0474fb8f53389e7d9c07f
def diff(n): if n == 1: return 2 else: return diff(n-1) + 3*n-1 n = int(input()) print(diff(n))
等差数列
https://www.nowcoder.com/practice/f792cb014ed0474fb8f53389e7d9c07f
def diff(n): if n == 1: return 2 else: return diff(n-1) + 3*n-1 n = int(input()) print(diff(n))
相关推荐