code for "Reverse Integer" (Simulation) [easy but worth more attention]