Basic exercises from hexadecimal decimal
Resource constraints
Time limit: 1.0s Memory Limit: 512.0MB
Problem Description
Input from the keyboard is not more than a positive 8-bit hexadecimal number string, converts it to the positive decimal number.
NOTE: hexadecimal number 10 to 15 are in uppercase letters A, B, C, D, E, F represents.
Sample input
FFFF
Sample Output
65535
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String a = in.next();
System.out.print(Long.valueOf(a,16));
}
}