题解 | 上楼梯
上楼梯
https://www.nowcoder.com/practice/876f9707382c4807928cc87a8eee9797
for _ in range(int(input())):
p, q, r = 0, 0, 1
for _ in range(int(input())):
p, q, r = q, r, p + q + r
print(r)
上楼梯
https://www.nowcoder.com/practice/876f9707382c4807928cc87a8eee9797
for _ in range(int(input())):
p, q, r = 0, 0, 1
for _ in range(int(input())):
p, q, r = q, r, p + q + r
print(r)
相关推荐