当前位置:网站首页>十进制数字→十六进制字符
十进制数字→十六进制字符
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);
}
}
边栏推荐
- ABP 6.0.0-rc.1的新特性
- WebView injects Js code to realize large image adaptive screen click image preview details
- ABAP 报表中如何以二进制方式上传本地文件试读版
- 金融业“限薪令”出台/ 软银出售过半阿里持仓/ DeepMind新实验室成立... 今日更多新鲜事在此...
- Flutter入门进阶之旅(五)Image Widget
- Intranet penetration tool ngrok usage tutorial
- 在北极都可以穿短袖了,温度飙升至32.5℃
- OOM排查和处理
- Go-based web access parameters
- h264协议
猜你喜欢
随机推荐
ABAP interview questions: how to use the System CALL interface of the ABAP programming language, direct execution ABAP server operating System's shell command?
腾讯欲成育碧最大股东/ 米哈游招NLP内容生成研究员/ AI发现四千余物种濒临灭绝...今日更多新鲜事在此...
Flutter Getting Started and Advanced Tour (2) Hello Flutter
位图与位运算
在已打开图片上加水印(文字)
保存Simulink仿真模型为图片或者PDF的方法
工作任务统计
发明时代,「幂集创新」事关你我
数据挖掘-05
1小时直播招募令:行业大咖干货分享,企业报名开启丨量子位·视点
ABP中的数据过滤器 (转载非原创)
金融业“限薪令”出台/ 软银出售过半阿里持仓/ DeepMind新实验室成立... 今日更多新鲜事在此...
ABP 6.0.0-rc.1的新特性
批量读取word docx文件指定表格内容,保存在excel文件中
生成上传密钥和密钥库
非科班AI小哥火了:他没有ML学位,却拿到DeepMind的offer
Flutter Getting Started and Advanced Tour (3) Text Widgets
About the handling of variable parameters in the Retrofit network request URL
Simple understanding of ThreadLocal
自定义VIEW实现应用内消息提醒上下轮播









