public class Case16 {
public static void main(String [] args){
int number = 245;
int shang = number/16;//15
int yu = number%16;//5
char result;
String tex = "";
if(yu<9){
result = (char)('0'+(yu));
}else{
result =(char)('A'+(yu-10));
}
tex = result + tex;
yu = shang%16;
shang = shang/16;
if(yu<9){
result = (char)('0'+(yu-0));
}else{
result =(char) ('A'+(yu-10));
}
tex = result +tex;
System.out.println("245的十六进制是:"+tex);
}
}