码迷,mamicode.com
首页 > 其他好文 > 详细

leetcode reverse integer

时间:2014-07-22 23:25:57      阅读:213      评论:0      收藏:0      [点我收藏+]

标签:io   re   c   leetcode   public   return   

public class Solution {
public int reverse(int x) {
int ret=0;
while(x!=0)
{
int t=x%10;
ret=ret*10+t;
x=x/10;


}


return ret;

}
}

leetcode reverse integer,布布扣,bubuko.com

leetcode reverse integer

标签:io   re   c   leetcode   public   return   

原文地址:http://www.cnblogs.com/hansongjiang/p/3861421.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!