package com.it.view;
public class Test {
StringBuffer str = new StringBuffer();
public static void main(String[] args) {
Test t = new Test();
System.out.println(t.Binafac(10));
}
//求出整数n的二进制
public StringBuffer Binafac(int n){
if(n==0){
return str.insert(0, 0);
}else{
str.insert(0,n%2);
return Binafac(n/2);
}
}
}