标签:style blog io color sp div on log as
1 class Solution 2 { 3 public: 4 5 int reverse(int x){ 6 int result=0; 7 while(x!=0) 8 { 9 result=result*10+x%10; 10 x/=10; 11 } 12 return result; 13 } 14 };
和判断整数是否是回文数字里面的方法一样。
标签:style blog io color sp div on log as
原文地址:http://www.cnblogs.com/gaoduan/p/4055269.html