1
Input example:
1 3 6 8 7
3 7 8 0 3
2 4 3 6 7
8 9 1 3 5
5 6 7 8 5
Output example:
5 3 6 8 7
3 3 8 9 3
2 4 3 6 7
8 0 1 7 5
5 6 7 8 1
I have so far this:
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
int [][] Matriz = new int [5][5];
for(int i = 0; i<5; i++ ){ 
    for(int j=0; j<5; j++){ 
        System.out.println("introduce un valor para la posicion "+ i +", "+ j);
        try{ 
            Matriz[i][j]= Integer.parseInt(in.readLine()); 
        }catch (Exception e){
            e.printStackTrace(); 
        } 
    } 
} 
for(int i = 0; i<5; i++ ){
    for(int j=0; j<5; j++){
        System.out.print(Matriz[i][j]+" ");
    } 
    System.out.println(); 
}
						
I guess I’d have to save the current value to a temporary variable to replace "on the other side"
– Lucas
I edited the answer
– ramaral
Thank you very much, it worked!
– Marcio.Rezende