返回列表 發帖
  1. import java.io.BufferedReader;
  2. import java.io.IOException;
  3. import java.io.InputStreamReader;


  4. public class AAA {
  5.        
  6.         BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
  7.         String str;
  8.         int i=108;
  9.         AAA() throws IOException
  10.         {
  11.                
  12.                         System.out.println(Integer.toBinaryString(Integer.parseInt(str)));
  13.                        
  14.                  System.out.println("-------------------------");
  15.                  System.out.println("10->2"+Integer.toBinaryString(i));
  16.                  System.out.println("10->8"+Integer.toOctalString(i));
  17.                  System.out.println("10->16"+Integer.toHexString(i));
  18.                  System.out.println("-------------------------");
  19.                  System.out.println("10->2"+Integer.valueOf("1101100", 2));
  20.                  System.out.println("10->8"+Integer.valueOf("154", 8));
  21.                  System.out.println("10->16"+Integer.valueOf("6c", 16));
  22.                 
  23.                 }
  24.         }
  25.         public static void main(String[] args) throws IOException {
  26.                 new AAA();

  27.         }

  28. }
複製代碼

TOP

返回列表