import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); String s=sc.next(); Integer a=Integer.valueOf(s, 16); String b=s.toUpperCase(); String c=Integer.toString(a, 8); String news=""; if(b.length()<3){ for (int i = 1; i <=3-b.length(); i++) { news+="0"; } news+=b; b=news; } if(c.length()<4){ news=""; for (int i = 1; i <=4-c.length(); i++) { news+="0"; } news+=c; c=news; } System.out.println("Hex: 0x"+b); System.out.println("Decimal: "+a); System.out.println("Octal: "+c); } }
0.0分
1 人评分