当前位置:网站首页>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;
}
边栏推荐
- Phpmailer reported an error: SMTP error: failed to connect to server: (0)
- 【thingsboard】替换首页logo的方法
- Learning notes 8
- As soon as I write the code, President Wang talks with me about the pattern all day
- Number of possible stack order types of stack order with length n
- Is "golden nine and silver ten" the best time to find a job? Not necessarily
- DFS and BFS concepts of trees and graphs
- Is there a sudden failure on the line? How to make emergency diagnosis, troubleshooting and recovery
- Machine learning -- neural network
- Summary of scene design
猜你喜欢

Use threejs to create geometry and add materials, lights, shadows, animations, and axes

Test d'automatisation de l'interface utilisateur télécharger manuellement le pilote du navigateur à partir de maintenant

Why can't all browsers on my computer open web pages

The development of mobile IM based on TCP still needs to keep the heartbeat alive

Containerd series - detailed explanation of plugins

@The problem of cross database query invalidation caused by transactional annotation

【虚幻引擎UE】打包报错出现!FindPin错误的解决办法

Pyqt pyside custom telescopic menu bar sharing (including tutorial)

【刷题】BFS题目精选

在线文本行固定长度填充工具
随机推荐
[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)
On the day 25K joined Tencent, I cried
陇原战“疫“2021网络安全大赛 Web EasyJaba
MacBook installation postgresql+postgis
Ffmepg usage guide
Looking back on 2021, looking forward to 2022 | a year between CSDN and me
Learning notes 8
25K 入职腾讯的那天,我特么哭了
基于TCP的移动端IM即时通讯开发仍然需要心跳保活
长度为n的入栈顺序的可能出栈顺序
Use threejs to create geometry and add materials, lights, shadows, animations, and axes
行为感知系统
Threejs implements labels and displays labels with custom styles
[phantom engine UE] realize the animation production of mapping tripod deployment
Interview summary: This is a comprehensive & detailed Android interview guide
根据入栈顺序判断出栈顺序是否合理
10种寻址方式之间的区别
MySQL: view with subquery in the from clause limit
The order of LDS links
web资源部署后navigator获取不到mediaDevices实例的解决方案(navigator.mediaDevices为undefined)