当前位置:网站首页>十进制数字→十六进制字符
十进制数字→十六进制字符
2022-08-09 12:25:00 【进击的李知因】
import java.util.Scanner;
public class Case10_NumberTo0xchar{
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("输入0~15之间的一个整数:");
int a = in.nextInt();
char result;
if(a>9)
result = (char)('A'+(a - 10));
else
result = (char)('0'+ a);
System.out.println("转为十六进制为:"+ result);
}
}
边栏推荐
- 注释、关键字、标识符的区别你知道吗?
- 二叉树的序列化和反序列化
- 水能自发变成“消毒水”,83岁斯坦福教授:揭示冬天容易得流感的部分原因...
- Flutter Getting Started and Advanced Tour (1) - Getting to Know Flutter
- 1-hour live broadcast recruitment order: industry big names share dry goods, and enterprise registration opens丨qubit·viewpoint
- Win10 compiles the x264 library (there are also generated lib files)
- Do you know the difference between comments, keywords, and identifiers?
- Report: The number of students who want to learn AI has increased by 200%, and there are not enough teachers
- How to save Simulink simulation model as image or PDF
- Flutter entry and advanced tour (6) Layout Widget
猜你喜欢
Flutter entry and advanced tour (6) Layout Widget
金融业“限薪令”出台/ 软银出售过半阿里持仓/ DeepMind新实验室成立... 今日更多新鲜事在此...
ABAP 报表中如何以二进制方式上传本地文件试读版
Intranet penetration tool ngrok usage tutorial
[HCIP Continuous Update] Principle and Configuration of IS-IS Protocol
脱光衣服待着就能减肥,当真有这好事?
Flutter入门进阶之旅(六)Layout Widget
造自己的芯,让谷歌买单!谷歌再度开源 180nm 工艺的芯片
注:检测到当前使用的ADB不是HBuilder内置或自定义ADB:PID为:9544进程名称为:adb.exe 路径为:c:\users\administrator\appdata\local\and
世界第4疯狂的科学家,在103岁生日那天去世了
随机推荐
大佬们,请教一下,我看官方文档中,sqlserver cdc只支持2012版之后的,对于sqlser
微服务架构的核心关键点
非科班AI小哥火了:他没有ML学位,却拿到DeepMind的offer
Manchester city launch emotional intelligence scarf can be detected, give the fans
glide工具类的简单封装
Customize VIEW to realize in-app message reminder to rotate up and down
WeChat Mini Program Payment and Refund Overall Process
随机快排时间复杂度是N平方?
内网穿透工具ngrok使用教程
位图与位运算
卷积神经网络表征可视化研究综述(1)
系统提供的堆 VS 手动改写堆
Glory to the Blue Yonder, speeds up the strategic growth
数字化转型之支撑保障单元
FFmpeg compiles and installs on win10 (configure libx264)
26、管道参数替换命令xargs
h264协议
Adalvo收购其首个品牌产品Onsolis
流量焦虑背后是企业对客户关系管理的不足
ViewPager fragments of nested data blank page abnormal problem analysis