当前位置:网站首页>十进制数字→十六进制字符
十进制数字→十六进制字符
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);
}
}
边栏推荐
- Simple understanding of ThreadLocal
- About the handling of variable parameters in the Retrofit network request URL
- 1-hour live broadcast recruitment order: industry big names share dry goods, and enterprise registration opens丨qubit·viewpoint
- OOM排查和处理
- Intra-group reverse order adjustment of K nodes
- Introduction to Flutter advanced trip Dialog&Toast (10)
- Flutter入门进阶之旅(一)-初识Flutter
- WeChat Mini Program Payment and Refund Overall Process
- #Internet of Things essay#Xiaoxiong pie equipment development actual combat
- FFmpeg在win10上编译安装(配置libx264)
猜你喜欢
The batch size does not have to be a power of 2!The latest conclusions of senior ML scholars
水能自发变成“消毒水”,83岁斯坦福教授:揭示冬天容易得流感的部分原因...
数字化转型之支撑保障单元
国产抗新冠口服药每瓶不超300元/ 我国IPv6网络全面建成/ 谷歌入局折叠屏手机...今日更多新鲜事在此...
Ten minutes to teach you how to use VitePress to build and deploy a personal blog site
张朝阳对话俞敏洪:一边是手推物理公式,一边是古诗信手拈来
新起之秀 DPU,正在掀起数据中心变革!
Flutter Getting Started and Advanced Tour (7) GestureDetector
GPT-3组合DALL·E,60秒内搞定游戏设定和原型动画!网友看后:这游戏想玩
内网穿透工具ngrok使用教程
随机推荐
生成上传密钥和密钥库
JVM之配置介绍(一)
novel research
Flutter Getting Started and Advanced Tour (4) Text Input Widget TextField
Flutter入门进阶之旅(一)-初识Flutter
AQS同步组件-FutureTask解析和用例
Glory to the Blue Yonder, speeds up the strategic growth
30行代码实现微信朋友圈自动点赞
腾讯欲成育碧最大股东/ 米哈游招NLP内容生成研究员/ AI发现四千余物种濒临灭绝...今日更多新鲜事在此...
The grep command Shell regular expressions, the three musketeers
【TKE】GR+VPC-CNI混用模式下未产品化功能配置
批量读取word docx文件指定表格内容,保存在excel文件中
你没见过的《老友记》镜头,AI给补出来了|ECCV 2022
Flutter入门进阶之旅(七)GestureDetector
鹅厂机器狗花式穿越10m梅花桩:前空翻、单桩跳、起身作揖...全程不打一个趔趄...
AI basketball referee, walking is special, ask harden care don't care
已解决IndentationError: unindent does not match any oute r indentation Level
Resolved IndentationError: unindent does not match any oute r indentation Level
[Microservice ~ Remote Call] Integrate RestTemplate, WebClient, Feign
Flutter入门进阶之旅(五)Image Widget