Package zsy.com;
Import java.util.ArrayList;
Import Java.util.Scanner;
public class Jinzhizhuanhuan {public
static void Main (string[] args) {
//TODO auto-generated method stub
Sca Nner in = new Scanner (system.in);
System.out.print ("Please input the number of your want to change:");
int a = In.nextint ();
String B = Get_result (change (a));
System.out.println (b);
}
public static arraylist<integer> Change (int n) {
arraylist<integer> rs = new arraylist<integer> ( );
int x = 0;
while (n!=0) {
x = n%;
Rs.add (x);
n = n/12;
}
return RS;
}
public static String Get_result (arraylist<integer> rs) {
int count = Rs.size ()-1;
String fin = "";
for (int i=count;i>=0;i--) {
if (rs.get (i) ==10) {
fin = fin + "A";
} else if (Rs.get (i) ==11) {
fin = fin + "B";
} else{
fin = fin + rs.get (i);
}
return fin;
}
running case and result screenshot: