no7专题

leetcode No7. Reverse Integer

Question: Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 Algorithm: 一位一位的取,然后乘以10 while循环的条件一定要写>0,因为如果-2147483648 程序就陷入死循环 Submitted Code: