当前位置:网站首页>十进制数字→十六进制字符
十进制数字→十六进制字符
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的新特性
- novel research
- MySQL principle and optimization of Group By optimization techniques
- 注:检测到当前使用的ADB不是HBuilder内置或自定义ADB:PID为:9544进程名称为:adb.exe 路径为:c:\users\administrator\appdata\local\and
- 西湖大学教授怎么看AI制药革命?|量子位智库圆桌实录
- 中断系统结构及中断控制详解
- Flutter entry and advanced tour (6) Layout Widget
- 注释、关键字、标识符的区别你知道吗?
- 位图与位运算
- Flutter入门进阶之旅(一)-初识Flutter
猜你喜欢

Compensation transaction and idempotency guarantee based on CAP components

内网穿透工具ngrok使用教程

脱光衣服待着就能减肥,当真有这好事?

透明tune proxy

Flutter Getting Started and Advanced Tour (4) Text Input Widget TextField

The new features of ABP 6.0.0 - rc. 1

数据挖掘-05

Rust从入门到精通04-数据类型

Flutter入门进阶之旅(八)Button Widget

Batch大小不一定是2的n次幂!ML资深学者最新结论
随机推荐
8、IDEA提交代码出现: Fetch failed fatal: Could not read from remote repository
世界第4疯狂的科学家,在103岁生日那天去世了
How to upload local file trial version in binary mode in ABAP report
MySQL5.6到8.0的账号迁移
保存Simulink仿真模型为图片或者PDF的方法
超越CLIP的多模态模型,只需不到1%的训练数据!南加大最新研究来了
报告:想学AI的学生数量已涨200%,老师都不够用了
SQL Server查询优化 (转载非原创)
K个结点的组内逆序调整
WebView注入Js代码实现大图自适应屏幕点击图片预览详情
Rust 入门指南(使用JSON)
系统提供的堆 VS 手动改写堆
Ten minutes to teach you how to use VitePress to build and deploy a personal blog site
Flutter Getting Started and Advanced Tour (7) GestureDetector
Flutter introduction advanced trip (5) Image Widget
ABP 6.0.0-rc.1的新特性
基于CAP组件实现补偿事务与幂等性保障
00后写个暑假作业,被监控成这笔样
Do you know the difference between comments, keywords, and identifiers?
中断系统结构及中断控制详解