By DePaul Dimadis
Choose your prefered Language: greek_flag uk_flag

A serial file named points_3D.txt (for the exercise solution you need to create it through a text editor or through MS Excel) contains an unknown number of lines that correspond to the three-dimensional cartesian point coordinates of a solid body. Each line of the file contains three double values ​​that correspond to the three cartesian coordinates of a point.
Specify a structure named coord_3D to manage the coordinates of the points of a solid body. The members of the structure are the three Cartesian coordinates () x, y, z, as defined previously. All values ​​are double.
Specify a matrix of coord_3D, N-site structures (N = known).
Consider a given known point A in the coordinate space () AAA, xyz (to be defined as double-type constants at the beginning of the program).
The data in the table of structures will be entered by accessing the point_3D.txt file if the distance, if A, id of the point, let i, from point A satisfies the relation: 1.0 <= da, i <= 10.0

If the number of recordings in the file is greater than the N value then the extra records of the file will not be included in the table of structures.
The following are requested (main () function:
1. import the data from the points_3D.txt file into the table of structures according to the above, checking the existence of the file (see the code below). If the file contains more than N points to find and display the number of file lines that satisfy condition A, 1.010.0id≤≤ and will not be included in the table of structures. If the file contains fewer than N lines, find and display the number of lines in the file that the structure table will contain.
2. Then find and display:
a. The point (or points, if more than one) of the matrix with the largest distance from point A.
b. The point (or points, if more than one) of the matrix with the shortest distance from point A.
c. The mean value of the distances of all points in the table of structures from point A.

FILE * fp;
errno_t err;
...
if (err = (fopen_s (& fp, filename, mode))! = 0)
{
printf ("error reading file .... \ n");
exit (1);
}
else // reading from file
{