16进制转化为10进制
#include <stdio.h>
#include <stdlib.h>
int main()
{
char str[10];
int i=0;
while (gets_s(str,10))
{
int d = 0;
for (i=0; str[i]; i++)
{
if (str[i] == '-')
{
printf("-");
}
if (str[i]>='0'&&str[i] <= '9')
d = d * 16 + (str[i] - '0');
else if(str[i]>='A'&&str[i]<='F')
d = d * 16 + (str[i] - 'A'+10);
}
printf("%d\n", d);
}
return 0;
}