}
}
for(j=i-1;j>=0;j--)
{
printf("%c",a[j]);
}
printf("\n");
}
#include <stdio.h>
#include <math.h>
#include<stdlib.h>
#include<string.h>
int main()
{
char a[1000] = {0}, c;
char* end;
char shi[200];
unsigned long long int shuzi, m;
while (gets_s(shi))
{
int i = 0, j = 0;
shuzi = strtoull(shi,&end,10);
if (shuzi == 0)
{
return 0;
}
else
{
while (shuzi != 0)
{
m = shuzi / 16;
if (shuzi % 16 == 0)
{
a[i++] = '0';
}
else
{
if (shuzi % 16 >= 10)
{
c = shuzi % 16 - 10 + 'A';
a[i++] = c;
}
else
{
c = shuzi % 16 + '0';
a[i++] = c;
}
}
shuzi = m;
}
}
for (j = i - 1; j >= 0; j--)
{
printf("%c", a[j]);
}
printf("\n");
}
return 0;
}