Write a program that calculates the distance of 2 points from the origin, as well as from each other. The distance between 2 points can be calculated using the formula:
d=√(〖(x_2-x_1)〗^2+〖(y_2-y_1)〗^2+〖(z_2-z_1)〗^2 )
- Read the coordinates of 2 3D points from the user. A point is represented by its x, y, and z coordinates.
- Calculate and print the distance of the first point from the origin, (0, 0, 0).
- Calculate and print the distance of the second point from the origin.
- Calculate and print the distance between the two points.
第一次用,试试行不行,行的话以后会标注悬赏。