回覆列表
  • 1 # 匠工加工

    很簡單的

    public class Test{

    private static void function7() {

    Scanner sc=new Scanner(System.in);

    int i=sc.nextInt();

    System.out.println("二進位制:"+Integer.toBinaryString(i));

    System.out.println("八進位制:"+Integer.toOctalString(i));

    System.out.println("十六進位制:"+Integer.toHexString(i));

    }

    }

    下面是修改過的

    public class Test{

    private static void function7() {

    Scanner sc=new Scanner(System.in);

    System.out.println("請輸入數字:");

    int i=sc.nextInt();

    System.out.println("二進位制:"+Integer.toBinaryString(i));

    System.out.println("八進位制:"+Integer.toOctalString(i));

    System.out.println("十六進位制:"+Integer.toHexString(i));

    }

    }

  • 2 # 變餅檔

    public class Test{

    private static void function7() {

    Scanner sc=new Scanner(System.in);

    System.out.println("請輸入數字:");

    int i=sc.nextInt();

    System.out.println("二進位制:"+Integer.toBinaryString(i));

    System.out.println("八進位制:"+Integer.toOctalString(i));

    System.out.println("十六進位制:"+Integer.toHexString(i));

    }

    }

  • 中秋節和大豐收的關聯?
  • 表達“離開”的詩句有哪些?