- import java.io.BufferedReader;
- import java.io.IOException;
- import java.io.InputStreamReader;
- public class AAA {
-
- BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
- String str;
- int i=108;
- AAA() throws IOException
- {
-
- System.out.println(Integer.toBinaryString(Integer.parseInt(str)));
-
- System.out.println("-------------------------");
- System.out.println("10->2"+Integer.toBinaryString(i));
- System.out.println("10->8"+Integer.toOctalString(i));
- System.out.println("10->16"+Integer.toHexString(i));
- System.out.println("-------------------------");
- System.out.println("10->2"+Integer.valueOf("1101100", 2));
- System.out.println("10->8"+Integer.valueOf("154", 8));
- System.out.println("10->16"+Integer.valueOf("6c", 16));
-
- }
- }
- public static void main(String[] args) throws IOException {
- new AAA();
- }
- }
複製代碼 |