int hextoDec(int hex)
{
int sum=0,mul=1;
int i,r;
int count=0;
do{
r=hex%16;
for(i=0;i<count;i++)
mul*=16;
mul*=r;
sum+=mul;
mul=1;
count++;
}while(hex/=16);
return sum;
}
标签:count,十六进制,16,int,sum,hex,mul,十进制,数转
来源: https://www.cnblogs.com/buxuwushu888/p/16579546.html