Toggle navigation
万里ACM
F.A.Qs
Web Board
ProblemSet
Source/Category
Status
Ranklist
Contest
[
ProblemSet
Status
Ranklist
OI Ranklist
Statistics
]
Login
Problem F: 走楼梯
Problem F: 走楼梯
Time Limit:
1 Sec
Memory Limit:
128 MB
Submit:
420
Solved:
298
[
Submit
] [
Status
] [
Web Board
] [Creator:
]
Description
楼梯有n级台阶,上楼可以一步上一阶,也可以一步上二阶。编一程序,计算共有多少种不同走法?
本题要求用递归算法实现。
Input
输入n(n<=50)
Output
输出走法的总数。
Sample Input
Copy
3
Sample Output
Copy
3