class Program
{ public static void main(String[] args){
//利用scanner封装键盘
Scanner scanner = new Scanner(System.in);
String str = "";
int i ;
//接收键盘输入
str = scanner.nextLine();
//讨论
if(isNumber(str)){
i = Integer.parseInt(str);
}else {
System.out.println("您输入的不正确,请重新输入");
}
String rezult = toBinary(i);
scanner.close();
}
public String toBinary(int i) {
//获取一个Stringbuilder
StringBuilder sb = new StringBuilder();
//运用while循环来算
while( i == 0 ){
int a = i % 2;
int i = i / 2;