Professional Documents
Culture Documents
Untitled Document 1
Untitled Document 1
* INSTRUCTION:
* This is a C++ starting code for hw6_1.
* When you finish the development, download this file.
* Note that the current filename is "main.cpp".
* But rename it to "main_hw6_1.cpp".
* After that, upload the renamed file on Canvas.
*/
#include <iostream>
#include <vector>
using namespace std;
void coinMatrix(
int row,
int column,
std::vector<std::vector<int>> &board,
int coin,
std::vector<std::pair<int, int>> currPath,
std::vector<std::pair<int, int>> &optPath,
int &maxcoin);
int main() {
// Declare the int values
int columns, rows;
// Initialize variables
std::vector<std::pair<int, int>> currPath;
std::vector<std::pair<int, int>> optPath;
int currCoin = 0;
int maxCoin = -1;
void coinMatrix(
int row,
int column,
std::vector<std::vector<int>> &board,
int coin,
std::vector<std::pair<int, int>> currPath,
std::vector<std::pair<int, int>> &optPath,
int &maxcoin){
// Look through the board and add coins for each cell
int currCoin = coin + board[row][column];