当前位置:网站首页>Decimal to hexadecimal
Decimal to hexadecimal
2022-07-05 04:13:00 【CSDNhdlg】
#include <stdio.h>
#include <stdlib.h>
#include<string.h>
int main()
{
long long int a;
scanf("%lld",&a);
char q[100],w[100];
int cnt=0;
if(a==0)
printf("0\n");
else{
while(a){
q[++cnt]=a%16;
a/=16;
}
int num=0,i,j;
for(i=1;i<=cnt;i++){
if(q[i]<10)
w[++num]=q[i]+'0';
else
w[++num]=q[i]-10+'A';
}
for(j=num;j>=1;j--)
printf("%c",w[j]);
}
return 0;
}
边栏推荐
- JVM garbage collection
- Test d'automatisation de l'interface utilisateur télécharger manuellement le pilote du navigateur à partir de maintenant
- The order of LDS links
- Interview byte, pass the exam and directly work on three sides. As a result, I found an architect to hang me?
- Rust区块琏开发——签名加密与私钥公钥
- 【虚幻引擎UE】实现背景模糊下近景旋转操作物体的方法及踩坑记录
- Hexadecimal to decimal
- Threejs realizes rain, snow, overcast, sunny, flame
- [moteur illusoire UE] il ne faut que six étapes pour réaliser le déploiement du flux de pixels ue5 et éviter les détours! (4.26 et 4.27 principes similaires)
- A應用喚醒B應該快速方法
猜你喜欢
【虚幻引擎UE】实现背景模糊下近景旋转操作物体的方法及踩坑记录
为什么百度、阿里这些大厂宁愿花25K招聘应届生,也不愿涨薪5K留住老员工?
【看完就懂系列】一文6000字教你从0到1实现接口自动化
Ctfshow web entry code audit
mysql的七种join连接查询
如何实现实时音视频聊天功能
ActiveReportsJS 3.1 VS ActiveReportsJS 3.0
A solution to the problem that variables cannot change dynamically when debugging in keil5
UI automation test farewell to manual download of browser driver
【虚幻引擎UE】实现UE5像素流部署仅需六步操作少走弯路!(4.26和4.27原理类似)
随机推荐
lds链接的 顺序问题
IronXL for . NET 2022.6
EasyCVR更改录像存储路径,不生成录像文件如何解决?
[brush questions] BFS topic selection
A應用喚醒B應該快速方法
CTF stegano practice stegano 9
[understand series after reading] 6000 words teach you to realize interface automation from 0 to 1
Hexadecimal to decimal
面试字节,过关斩将直接干到 3 面,结果找了个架构师来吊打我?
阿里云ECS使用cloudfs4oss挂载OSS
ActiveReportsJS 3.1 VS ActiveReportsJS 3.0
How to remove installed elpa package
FFmepg使用指南
Get to know MySQL connection query for the first time
Threejs Internet of things, 3D visualization of farms (I)
Test d'automatisation de l'interface utilisateur télécharger manuellement le pilote du navigateur à partir de maintenant
【虚幻引擎UE】实现测绘三脚架展开动画制作
Rome链分析
Wechat applet development process (with mind map)
Containerd series - what is containerd?