Pro
1
2
Michael has a beautiful house. There is only one
staircase to reach his bedroom. He used to climb
either 1 stair or 2 stairs at a time. If we consider all
possible combinations of climbing, in how many ways
can Michael reach to the top?
Input Format
An Integer P denotes the number of stairs in the
staircase.
If the number of stairs beyond 20, the output should
print Wrong infrastructure".
Output Format
The number of ways
Michael can dimo the staircase to
reach to the top.
constraints
ARE=20
Sample 1:
Input:
5
Output:
8
Answers
Answered by
0
Explanation:
Pro
1
2
Michael has a beautiful house. There is only one
staircase to reach his bedroom. He used to climb
either 1 stair or 2 stairs at a time. If we consider all
possible combinations of climbing, in how many ways
can Michael reach to the top?
Input Format
An Integer P denotes the number of stairs in the
staircase.
If the number of stairs beyond 20, the output should
print Wrong infrastructure".
Output Format
The number of ways
Michael can dimo the staircase to
reach to the top.
constraints
ARE=20
Sample 1:
Input:
5
Output:
8
Similar questions