Update divide.cpp

rewrote code with Damian and Kevin's Template/Format since typeid won't work with switch.