Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @author pablosky
- * Este es el proyecto de laberinto por backtracking
- */
- public class Main {
- /**
- * @param args
- */
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- Scanner escaner = new Scanner(System.in);
- int tamanio = escaner.nextInt();
- escaner.nextLine();
- char [][] matrix = new char [tamanio][tamanio];
- leerMatriz(matrix,tamanio,escaner);
- }
- public static void leerMatriz(char [][] matriz, int tam, Scanner scan) {
- for (int i = 0; i < tam; i++) {
- String linea = scan.nextLine();
- matriz[i] = linea.toCharArray();
- }
- }
- public static void printeaMatriz(char [][] matriz, int tam) {
- for (int i = 0; i < tam; i++) {
- for (int j = 0; j < tam; j++) {
- System.out.print(matriz[i][j]);
- }
- System.out.println();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement