CS3353 4
CS3353 4
Homework #4
Code
#include <iostream>
using namespace std;
#include<vector>
int M = matrix.size();
int N = matrix[0].size();
path.push_back(matrix[i][j]);
while (true) {
switch (opt) {
case 0:
cout << "Enter new Horizontal Axis size: ";
cin >> x_axis;
break;
case 1:
cout << "Enter new Vertical Axis size: ";
cin >> y_axis
;
break;
case 2: {
cout << "Paths from (0,0) to (" << x_axis - 1 << "," << y_axis -
1 << "):\n";
findPath(matrix, 0, 0, path);
break;
}
case 3:
cout << "Quitting Program...\n";
return 0;
default:
cout << "Invalid choice. Please try again.\n";
}
}
return 0;
}
SELF TESTING