public static String tran(int a){
//con:商;rem:余数;last:最后承载结果的变量
int con;
String rem = "",last = "";
//循环将余数储存在变量rem中
flag:while (true){
rem += (a % 2 + "");
a /= 2;
if (a == 0){
break flag;
}
}
//将获得的余数倒置,存储在变量last中
for (int i = rem.length() - 1;i >= 0;i--){
last += rem.charAt(i);
}
return last;
}