Professional Documents
Culture Documents
* 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>
#include <utility>
using namespace std;
int main()
{
int rows, columns;
}
inputBoard.push_back(rowInput);
}
}
}
//Push each row to max coin board
maxCoinBoard.push_back(rowValues);
}
do{
//If the row is 0 then set the next index to the left square
if(currentIndex.first == 0)
{
currentIndex.first = currentIndex.first;
currentIndex.second = currentIndex.second-1;
}
//If the column is 0 or if top index is greater than left index, set next
index to top square
else if(currentIndex.second == 0 || maxCoinBoard[currentIndex.first-1]
[currentIndex.second] > maxCoinBoard[currentIndex.first][currentIndex.second-1] )
{
currentIndex.first = currentIndex.first-1;
currentIndex.second = currentIndex.second;
}
else
{
currentIndex.first = currentIndex.first;
currentIndex.second = currentIndex.second-1;
}