#include #include #include #include #include #include using namespace std; class Planet { public: int x,y,z; Planet(int x, int y, int z){ this->x = x; this->y = y; this->z = z; } Planet(){ x = rand()%2000 - 1000; y = rand()%2000 - 1000; z = rand()%2000 - 1000; } double distanceTo(Planet p){ return sqrt(pow(p.x - x, 2) + pow(p.y - y, 2) + pow(p.z - z, 2)); } void print(){ cout<>n; cout<<"Planets:\n"; vector v; for(int i=0; i farDist){ farDist = dist; farA = i; farB = j; } } } cout<<"The planets closest to each other:\n"; cout<<"Planet "<