class Triangulo
{
public static void main(String R[])
{ new Triangulo(); }
public Triangulo()
{
Triangulito TR = new Triangulito();
TR = LeeDatos();
}
Triangulito LeeDatos()
{
Triangulito TR = new Triangulito();
TR.L1.P1.X = Lectura('x', 1, 1);
TR.L1.P1.Y = Lectura('y', 1, 1);
TR.L1.P2.X = Lectura('x', 1, 2);
TR.L1.P2.Y = Lectura('y', 1, 2);
TR.L2.P1.X = Lectura('x', 2, 1);
TR.L2.P1.Y = Lectura('y', 2, 1);
TR.L2.P2.X = Lectura('x', 2, 2);
TR.L2.P2.Y = Lectura('y', 2, 2);
TR.L3.P1.X = Lectura('x', 3, 1);
TR.L3.P1.Y = Lectura('y', 3, 1);
TR.L3.P2.X = Lectura('x', 3, 2);
TR.L3.P2.Y = Lectura('y', 3, 2);
return TR;
}
int Lectura(char C, int L, int P)
{
int X;
String CAD = "Valor de "+C+" de Linea"+L+" Punto"+P;
X = Integer.parseInt(Lectura.LeeDato(CAD));
return X;
}
}
class Punto { int X, Y; };
class Linea
{
Punto P1 = new Punto();
Punto P2 = new Punto();
float Longitud;
};
class Triangulito
{
Linea L1 = new Linea();
Linea L2 = new Linea();
Linea L3 = new Linea();
double Area;
};