Blue Bridge Cup: Hexadecimal 1949

topic

[Problem description]
   What is the decimal number corresponding to the hexadecimal number 1949? Please pay special attention to the given hexadecimal system and the decimal system.
[Answer Submission]
   This is a question that fills in the blanks with the result, you only need to calculate the result and submit it. The result of this question is an integer. Only fill in this integer when submitting the answer. If you fill in the extra content, you will not be able to score.

answer

   6473

Precautions

   The first parameter type of Integer.parseInt("1949", 16) is String, and the "" double quotes cannot be dropped

Code

public class Main {
    
    //蓝桥杯要求class命名为Main,且无package
    public static void main(String[] args) {
    
    
        int num = Integer.parseInt("1949", 16);//将16进制的1949转换为10进制
        System.out.println(num);
    }
}





Guess you like

Origin blog.csdn.net/qq_47168235/article/details/108911180