#13198: 求解JAVA高手


nina042152086 (unknown)

學校 : 國立高雄第一科技大學
編號 : 74189
來源 : [163.18.38.88]
最後登入時間 :
2018-01-05 11:21:12
a111. 12149 - Feynman -- UVa12149 | From: [163.18.38.88] | 發表日期 : 2018-01-03 20:21

A file called txt records the coordinates of 100 points in the plane. Please use JAVA language to implement the following requirements.

1.Read the file and calculate the distance of the adjacent record, i.e., you need to calculate the distance of two points 1-2, 2-3, 3-4,……,98-99, 99-100, a total of 99 distances.

2.Write the distances to a new file called dist.txt with the following format,distance_index distance(for example: 18).

  The distance_index is equal to the smaller point index of the two points. For example, distance of point 1 and point 2 is indexed with 1.

3.Please also find the shortest and longest distance and list them in the end of the file. Please specify their distance_index as well.

 
ZeroJudge Forum