mirror of
https://gitlab.com/tutorial-java-rafa-munoz/tutorial-java-2024-25/tutorialjava2024-25.git
synced 2025-11-10 02:13:07 +01:00
feat(ch 5): example & ex added
This commit is contained in:
@@ -23,7 +23,6 @@ public class Ejercicio02_findAndReplace {
|
||||
* @return
|
||||
*/
|
||||
public static void findAndReplace (int b[], int buscado, int reemplazo) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
|
||||
for (int i = 0; i < b.length; i++) {
|
||||
if (b[i] == buscado) {
|
||||
|
||||
@@ -4,13 +4,14 @@ public class Ejercicio04_MatrizConBordeYCeroAlAzar {
|
||||
|
||||
public static void main(String[] args) {
|
||||
// Declaración de variables
|
||||
char matriz[][] = new char[20][10];
|
||||
char matriz[][] = new char[10][20];
|
||||
int posicionAzarFila, posicionAzarColumna;
|
||||
|
||||
// La relleno de espacios en blanco
|
||||
for (int i = 0; i < matriz.length; i++) {
|
||||
for (int j = 0; j < matriz[i].length; j++) {
|
||||
if (i == 0 || i == (matriz.length - 1) || j == 0 || j == (matriz[0].length - 1)) {
|
||||
if (i == 0 || i == (matriz.length - 1) ||
|
||||
j == 0 || j == (matriz[0].length - 1)) {
|
||||
matriz[i][j] = '*';
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user