// Template for IS2610 ASN1 spanning tree gendist.c program #include #define MAXN 1300 float xpos[MAXN], ypos[MAXN]; int npoints; // keep track of actual # of points read #define MAXL 300 // A generous max line length char line[MAXL]; float dist(float x0, float y0, float x1, float y1) { float dx, dy, d; /* * Insert your code for the Pythagorean distance between 2 points */ return(d); } main() { int i, j; // This loop reads the latitude and longitude values from latlong.txt while(fgets(line, MAXL, stdin)) { if(sscanf(line, "%f %f", &xpos[npoints], &ypos[npoints]) != 2) break; npoints++; } /* * Insert your code here to print all of the city to city distances. * The output will be "%f %d %d %f %f %f %f\n" format with * the distance, i, j, and both city x y positions. */ return(0); }