蓝桥杯·十进制转十六进制·Java实现

这部分是用格式转换输出来实现的。

import java.util.Scanner;
public class Main  {

    public  static  void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int nums = sc.nextInt();
        System.out.println(Integer.toHexString(nums).toUpperCase());
    }

}

猜你喜欢

转载自xiqingongzi.iteye.com/blog/2344195
今日推荐