Professional Documents
Culture Documents
Main
Main
*;
/*
* INSTRUCTION:
* This is a Java starting code for hw6_1.
* When you finish the development, download this file.
* Note that the current filename is "Main.java".
* But rename it to "Main_hw6_1.java".
* After that, upload the renamed file on Canvas.
*/
class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
// Setup 2 dimension array to take input
int rows = scan.nextInt();
int columns = scan.nextInt();
int[][] maze = new int[rows][columns];
int[][] finished = new int[rows][columns];
int max = 0;
int value = 0;
if (maze[i][a] == 1) {
value++;
}
if (i == 0 && a == 0) {
finished[i][a] = value;
} else {
if (i == 0 && a > 0) {
value = value + maze[i][a - 1];
}
if (i > 0 && a == 0) {
value = value + maze[i - 1][a];
}
System.out.print("Path:");
for(int r = 0; r < path.size(); r++){
System.out.print(path.get(r));
}
System.out.println();
}
}