By DePaul Dimadis
Choose your prefered Language: greek_flag uk_flag

Consider N cities (N = known) for which their coordinates are known, x y a known pair numerical positive double values ​​for each city.
Coordinates are created randomly in the region values ​​[0.0, 999.0] and are entered into a one - dimensional arithmetic table including coordinates for all cities.

Write a C language program that will find the city (or cities) that are the shortest overall distance from all other cities, with an accuracy of 10-2.
The program will show the city / city cities) as well as the shorter total distance.

  • EXAMPLE for N = 5 (2.5, 5.0), (5.1, 3.0), (1.0, 9.0), (5.4, 54.0), (5.5, 2.1)

The city with the smallest total distance, 60.81, is the city with coordinates (2.5, 5.0)