题解 | 大吉大利,今晚吃鸡
大吉大利,今晚吃鸡
https://www.nowcoder.com/practice/c9d9f9c60b4448eabc0569f80a3461bb
def f(n):
if n == 0:
return 0
elif n == 1:
return 2
elif n == 2:
return 8
else:
return 3 * f(n-1) + 2
while True:
try:
n = int(input())
s = f(n)
print(s)
except:
break