newClass
This commit is contained in:
parent
d3f8d942c4
commit
4bd6ba084c
24
MinMatrix.java
Normal file
24
MinMatrix.java
Normal file
@ -0,0 +1,24 @@
|
||||
/**
|
||||
* MinMatrix
|
||||
*/
|
||||
public class MinMatrix {
|
||||
public static void main(String[] args) {
|
||||
int[][] M = { { 31, 53, 65 }, { 23, 86, 99 }, { 5, 45, 66 } };
|
||||
int temp = M[0][0];
|
||||
System.out.println("This is the matrix memory allocation");
|
||||
System.out.println(M);
|
||||
System.out.println("");
|
||||
for (int i = 0; i < M.length; i++) {
|
||||
System.out.println("");
|
||||
for (int j = 0; j < M[i].length; j++) {
|
||||
System.out.print(M[i][j]);
|
||||
System.out.print("\t");
|
||||
if (M[i][j] < temp) {
|
||||
temp = M[i][j];
|
||||
}
|
||||
}
|
||||
}
|
||||
System.out.println("");
|
||||
System.out.println("The smallest number in this Matrix is: " + temp);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user