Can I print this with triangle shape in Java?
I tried to print this with only border "1"s:
int[][] matrix = new int[5][5];
for (int i = 0; i < 5; i++) {
matrix[i][i] = 1;
matrix[i][0] = 1;
}
Can I print this with triangle shape in Java?
I tried to print this with only border "1"s:
int[][] matrix = new int[5][5];
for (int i = 0; i < 5; i++) {
matrix[i][i] = 1;
matrix[i][0] = 1;
}