import java.io.*;
public class P {
public static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
public static int [][] Graph;
public static int [][] Tree;
public static tempEdge [] tedges;
private static int tempi = 0, one, two, size;
public void buildTable(String file){
n = 5;
tedges = new tempEdge[n*(n-1)/2];
try{
BufferedReader input = new BufferedReader(new FileReader(file));
while(input.ready())
{
String tmp = input.readLine();
String[] newPoint = tmp.split(" ");
int p1 = Integer.parseInt(newPoint[0]);
int p2 = Integer.parseInt(newPoint[1]);
int dis = Integer.parseInt(newPoint[2]);
tedges[tempi] = new tempEdge(p1,p2,dis);
System.out.println(tedges[tempi].firstPoint());
System.out.println(tedges[tempi].secondPoint());
System.out.println(tedges[tempi].distance());
tempi++;
}
}
catch(IOException e)
{
System.out.println("Error, file does not exist");
}
p();
}
//create a minal spanning tree
public static void p()
{
n = 5;
//set size of the array which store different things
Graph = new int[n+1][n+1];
Tree = new int[n+1][3];
while(tedges != null){
for(int i=0;i<=tedges.length;i++){
//tempEdge e = tedges[i];
one = tedges[i].firstPoint();
two = tedges[i].secondPoint();
size = tedges[i].distance();
if((one!=two)&&(one<two)) {
Graph[one][two] = Graph[two][one] = size;
}
}
}
.....
public static void main (String[] args) throws IOException
{
P p = new P();
p.buildTable("3Dtriangle.txt");
}
}