import java.util.Scanner;
class Text {
public static void main(String[] fgd) {
Scanner sc = new Scanner(System.in);
System.out.println("请输入一个数");
long number = sc.nextLong();
String L ="";
while (true) {
int x = (int)(number%16);
if (x == 10) {
L = "a" + L;
}else if (x == 11) {
L = "b" + L;
}else if (x == 12) {
L = "c" + L;
}else if (x == 13) {
L = "d" + L;
}else if (x == 14) {
L = "e" + L;
}else if (x == 15) {
L = "f" + L;
}else {
L = x + L;
}
number /= 16;
if (number ==0) {
break;
}
}
System.out.println(L);
}
}
|
|