public void test(int n){
String temp = "";
if(n == 0){
System.out.println(0);
}else if(n > 0){
temp = fuzhu(n);
System.out.println(temp);
}else{
System.out.println("无法计算负数");
}
}
public String fuzhu(int n){
String temp = "";
while(n > 0){
if (n%2 == 1){
temp = 1 + temp;
}else{
temp = 0 + temp;
}
n = n/2;
}
return temp;
}