Update OOP/Java/Lab/Week4/MatrixMulp.java
This commit is contained in:
parent
dfc539c64c
commit
f7cc8cb99a
1 changed files with 2 additions and 0 deletions
|
@ -43,6 +43,7 @@ class MatrixMulp {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Adding matrices
|
||||||
if (m == p && n == q) {
|
if (m == p && n == q) {
|
||||||
int[][] C = new int[m][n];
|
int[][] C = new int[m][n];
|
||||||
for (int i = 0; i < m; i++) {
|
for (int i = 0; i < m; i++) {
|
||||||
|
@ -54,6 +55,7 @@ class MatrixMulp {
|
||||||
printMatrix(C);
|
printMatrix(C);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Multiplying matrices
|
||||||
if (n == p) {
|
if (n == p) {
|
||||||
int[][] D = new int[m][q];
|
int[][] D = new int[m][q];
|
||||||
for (int i = 0; i < m; i++) {
|
for (int i = 0; i < m; i++) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue