CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
jackfrued

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: jackfrued/Python-100-Days
Path: blob/master/公开课/文档/第06次公开课-算法入门系列2-在水一方/code/example02.py
Views: 729
1
def climb(num):
2
a, b, c = 1, 2, 4
3
for _ in range(num - 1):
4
a, b, c = b, c, a + b + c
5
return a
6
7
8
def main():
9
n = int(input('台阶数量: '))
10
print(climb(n))
11
12
13
if __name__ == '__main__':
14
main()
15
16