Documentos de Académico
Documentos de Profesional
Documentos de Cultura
PROGRAMACIÓN II
0 1 2
0 1 1 2
1 0 0 3
2 0 0 5
3 0 0 8
4 0 0 13
5 0 0 21 6x3
matriz2(A[][], f, c)
public static void matriz2(int A[][], int f, int c)
z=x+y
A[i][c-1]=z
x=y
y=z
fin
2
mostrar(A[][], f, c)
fin
PROGRAMA PRINCIPAL
import java.util.Scanner;
EJECUCIÓN:
0 1 2
0 5 3 1
1 11 9 7
2 17 15 13
3 23 21 19 4X3
{
i=0, f-1, 1
for(j=c-1;j>=0;j--)
{ A[i][j]=d;
j=c-1, 0, -1
d=d+2;
A[i][j]=d }
d=d+2 }
fin
4
PROGRAMA PRINCIPAL
import java.util.Scanner;
INICIO public class Ejemplo3GeneracionMatrices {
//Escribir aquí el código de los procedimientos
int m, n;
Scanner leer=new Scanner(System.in);
DIM B[m][n]
System.out.print("Número de filas: ");
m=leer.nextInt();
System.out.print("Número de columnas: ");
Matriz3(B, m,n) n=leer.nextInt();
mostrar(B,m,n) int B[][]= new int[m][n];
matriz3(B, m,n);
System.out.println("La matriz es:");
FIN mostrar(B,m,n);
}
}
EJECUCIÓN: