-
Notifications
You must be signed in to change notification settings - Fork 76
Expand file tree
/
Copy path24_StepWalking.cpp
More file actions
22 lines (17 loc) · 865 Bytes
/
24_StepWalking.cpp
File metadata and controls
22 lines (17 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// For this challenge you will determine how many different ways you can walk up a flight of stairs.
/*
have the function StepWalking(num) take the num parameter being passed which will be an integer between 1 and 15 that represents the number of stairs you will have to climb. You can climb the set of stairs by taking either 1 step or 2 steps, and you can combine these in any order. So for example, to climb 3 steps you can either do: (1 step, 1 step, 1 step) or (2, 1) or (1, 2). So for 3 steps we have 3 different ways to climb them, so your program should return 3. Your program should return the number of combinations of climbing num steps.
*/
#include <iostream>
#include <string>
using namespace std;
// NOT FINISHED
int StepWalking(int num)
{
}
int main()
{
cout << StepWalking(3) << endl; // 3
cout << StepWalking(1) << endl; // 1
return 0;
}