Write a program that reads in a list of 3D points
(x,y,z) and prints them out in increasing distance
from the origin. The points should be represented as arrays
of length 3. Here's my solution.
Below is a sample run of the program:
How many points? 3
Enter points (x,y,z): (1,0,1) (1,0,-1.2) (-1,1,-1)
(1,0,1) (1,0,-1.2) (-1,1,-1)
- Try the same thing, but sort by x-values, breaking ties
by y-values, breaking those ties by z-values.
- Try the same thing, but sort in increasing order of
distance from a point given by the user.