标签:ever int uil 数字 ace eof admin while builder
package com.net163.question; import org.junit.Test; /** * Created by Administrator on 2016/11/11 0011. */ public class ReverseNumber { private int x = 123 , y=100; public int reverse(int num){ String strX = new StringBuilder(String.valueOf(num)).reverse().toString(); while(strX.toCharArray()[0]==‘0‘){ strX = strX.replaceFirst("0",""); } return Integer.valueOf(strX); } @Test public void testReverseNumber(){ System.out.println(reverse(reverse(x)+reverse(y))); } }
标签:ever int uil 数字 ace eof admin while builder
原文地址:http://www.cnblogs.com/winters1992/p/6053538.html