当前位置:网站首页>405. Convert a Number to Hexadecimal
405. Convert a Number to Hexadecimal
2022-08-03 17:02:00 【51CTO】
Given an integer, write an algorithm to convert it to hexadecimal. For negative integer, two’s complement method is used.
Note:
All letters in hexadecimal (a-f) must be in lowercase.
The hexadecimal string must not contain extra leading 0s. If the number is zero, it is represented by a single zero character ‘0’; otherwise, the first character in the hexadecimal string will not be the zero character.
The given number is guaranteed to fit within the range of a 32-bit signed integer.
You must not use any method provided by the library which converts/formats the number to hex directly.
Example 1:
Example 2:
边栏推荐
- Excuse me this hologres dimension table is cached?How to Finished
- Understand the recommendation system in one article: Outline 02: The link of the recommendation system, from recalling rough sorting, to fine sorting, to rearranging, and finally showing the recommend
- JS中对象数组用sort按属性排序
- FinClip | July 2022 Product Highlights
- C语言02、语句、函数
- 大佬们。使用flink-cdc-sqlserver 2.2.0 版本读取sqlserver2008R
- 【There is no tracking information for the current branch. Please specify which branch you want to 】
- 2年开发经验去面试,吊打面试官,即将面试的程序员这些笔记建议复习
- 我想请问下,我们的数据库是在亚马逊,Dataworks 连不通,怎么办?
- 超分重建数据集
猜你喜欢

中小微企业如何简单便捷、低成本实现数字化?360视觉云有妙招

C专家编程 第1章 C:穿越时空的迷雾 1.10 “安静的改变”究竟有多少安静

J9数字虚拟论:元宇宙的潜力:一股推动社会进步的力量

11. Container With Most Water

Adobe是什么?

Huawei, Lenovo, BAIC, etc. were selected as the first batch of training bases for "Enterprise Digital Transformation and Security Capability Improvement" by the Ministry of Industry and Information Te

Hannah荣获第六季完美童模全球总决赛全球人气总冠军

leetcode:189. 轮转数组
![[Unity Starter Plan] Making RubyAdventure01 - Player Creation & Movement](/img/e9/9bba4f7ecee81ae7ce7e492b54ee11.png)
[Unity Starter Plan] Making RubyAdventure01 - Player Creation & Movement

Interviews are no longer hanged!This is the correct way to open the seven schemes of Redis distributed locks
随机推荐
组件通信--下拉菜单案例
SwinIR实战:如何使用SwinIR和预训练模型实现图片的超分
华为、联想、北汽等入选工信部“企业数字化转型和安全能力提升”首批实训基地
C专家编程 第1章 C:穿越时空的迷雾 1.6 它很棒,但它符合标准吗
“68道 Redis+168道 MySQL”精品面试题(带解析),你背废了吗?
【系统学习编程-编程入门-全民编程 视频教程】
Understand the recommendation system in one article: Outline 02: The link of the recommendation system, from recalling rough sorting, to fine sorting, to rearranging, and finally showing the recommend
security加密解密
【数仓】数据质量监控
超分重建数据集
node connection mongoose database process
Description of the functional scenario of "collective storage and general governance" in the data center
#夏日挑战赛#【FFH】OpenHarmony设备开发基础(四)启动流程
C专家编程 第1章 C:穿越时空的迷雾 1.11 轻松一下---由编译器定义的Pragmas效果
我想请问下,我们的数据库是在亚马逊,Dataworks 连不通,怎么办?
C专家编程 第1章 C:穿越时空的迷雾 1.7 编译限制
C专家编程 第3章 分析C语言的声明 3.4 通过图标分析C语言的声明
sibling component communication context
【Metaverse系列一】元宇宙的奥秘
TiKV & TiFlash 加速复杂业务查询丨TiFlash 应用实践