C++ code for n-bodies simulations