Distance Traveled C++