0001+x用什么算法能做出来啊解决办法

   阅读
0001+x用什么算法能做出来啊
想了半天做法都很笨笨啊
例如:
0001+10=0010

0999999+2   =100001

------解决方案--------------------
我估计是Java编译器在编译的时候直接把001转化成1了,所以运行才不会出问题。
------解决方案--------------------
import java.lang.Integer;
class t
{
public static void main(String[] args)
{
String no = "00000001 ";
int x=10;
int re = Integer.valueOf(no).intValue();
re = re + x;
no = String.valueOf(re);
int a = no.length();
for(int i = 0; i < 8 - a ; i++){
no = "0 " + no;
}
System.out.println(no);
}
}
阅读