#include using namespace std; int countWays(int); int main() { int ways, stairs; cout << "enter number of stairs: "; cin >> stairs; ways = countWays(stairs); cout << ways << endl; return 0; } int countWays(int numStairs) { if(numStairs == 1) { return 1; } else if(numStairs == 0) { return 0; } else { return countWays(numStairs -1) + countWays(numStairs - 2) + countWays(numStairs -2); } }