You have 9 locations (loca = 1 through 9).
You'll create 2 nested FOR-NEXT loops.
FOR counter_a = 1 to 9
FOR counter_b = (counter_a + 1) to 9
(add a routine to skip cases where counter_a = counter_b)
At the beginning of the program you stored the x values in x(loca) and the y values in y(loca).
Calculate distance between the current pair of points x(counter_a), y(counter_a) and x(counter_b), y(counter_b).
Store in an array named 'dist (counter_a, counter_b)'
That's the general idea. You'll have to fill in the details.