/*
- To change this license header, choose License Headers in Project Properties.
- To change this template file, choose Tools | Templates
- and open the template in the editor.
*/
package programamatrizes;
import java.util.Scanner;
/**
*
-
@author Rafa
*/
public class somaMatrizes {
int[][] leituraMatrizA( ){
Scanner entrada = new Scanner(System.in);
int A[][]= new int [5][5];
for(int i=0; i<5; i++){
for(int j=0; j<5; j++){
System.out.printf("Digite o elemento Matriz A [%d][%d]: ", i+1,j+1);
A[i][j]=entrada.nextInt();
}
}
return A;
}
int[][] leituraMatrizB(){
Scanner entrada = new Scanner(System.in);
int B[][]= new int [5][5];
for(int i=0; i<5; i++){
for(int j=0; j<5; j++){
System.out.printf("Digite o elemento B [%d][%d]: ", i+1,j+1);
B[i][j]=entrada.nextInt();
}
}
return B;
}
int[][] soma(){
Scanner entrada = new Scanner(System.in);
int C[][]= new int [5][5];
for(int i=0; i<5; i++){
for(int j=0; j<5; j++){
C[][]=leituraMatrizB(A[i][j])+leituraMatrizA(B[i][j]); estou com uma dúvida aqui pessoal como realizo essa operação.
System.out.print(C[i][j] + " "); //imprime caracter a caracter
}
}
return C;
}
}