1. 程式人生 > >藍橋杯 基礎練習 十六進制轉十進制

藍橋杯 基礎練習 十六進制轉十進制

溢出 oid import scan post 文件 ava 轉化 藍橋杯

import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.next();
System.out.println(Long.parseLong(str,16));
}
}

其中系統的一個檢測文件轉化成int會溢出,所以使用Long

藍橋杯 基礎練習 十六進制轉十進制