如果一个数输入时为十进制,可用scanf中的%x直接输出其十六进制下对应的数值
#include<stdio.h>
int main(){
int x;
scanf("%d",&x);
printf("%x",x);
return 0;
}
标签:十六进制,输出,int,scanf,include,十进制
From: https://www.cnblogs.com/kk3-share/p/17545374.html
#include<stdio.h>
int main(){
int x;
scanf("%d",&x);
printf("%x",x);
return 0;
}
标签:十六进制,输出,int,scanf,include,十进制
From: https://www.cnblogs.com/kk3-share/p/17545374.html