MATRIZ EN DIAGONAL
import java.io.*;
class matris
{
public static void main (String arg[])
{
float A [][]=new float [3][3];
for (int i=0;i<4;i++)
{
for (int t=0;t<4;t++)
{
if(i==t)
{
A[i][t]=5;
}
else
{
A[i][t]=0;
}
System.out.println(A[i][t]);
}
}
}
}
MATRICES
import java.io.*;
class vector
{
public static void main (String arg[])
{
float P=0;
float Q=3;
float mul;
float A [][]=new float [3][3];
float B [][]=new float [3][3];
for (int i=0;i<4;i++)
{
for (int t=0;t<4;t++)
{
P=Q;
mul=P*P;
A[i][t]=mul;
System.out.println(A[i][t]);
Q=Q+1;
}
}
}
}
No hay comentarios:
Publicar un comentario