public class BigInteger {
int sing;
byte[] val;
public BigInteger(int val){
// 将传递的初始值,按位取值,存入字节数组中
int val2 = val;
int i=0;
while(val/2!=0){
val = val/2;
i++;
}
i++;
this.val = new byte[i];
int j=0;
while(val2/2!=0){
this.val[j++] = (byte) (val2%2);
val2 = val2/2;
}
this.val[j]=(byte) (val2%2);
}
public static void main(String[] args) {
System.out.print("请输入要转换为二进制的数:");
BigInteger bigInteger = new BigInteger(new Scanner(System.in).nextInt());
for(int i=bigInteger.val.length-1;i>=0;i--){
System.out.print(bigInteger.val[i]);
}
}
}