Finish 6.5-3.cpp