#include
#include
void main(void)
{
int tmpInput,tmpOuput;
printf("请输入待转换的数:");
scanf("%d",&tmpInput);
printf("%d = ",tmpInput);
printf("0x%x",tmpInput);
getch();
}
#include
char f(int n)
{
return "0123456789ABCDEF"[n];
}
int main()
{
int n,i=0;
char hex[20]="";
scanf("%d",&n);
while(n)
{
hex[i++]=f(n%16);
n/=16;
}
for(i--;i>=0;i--)
printf("%c",hex[i]);
return 0;
}