从右向左将每一位的数字依次乘上2的n次方(n为二进制数从右数位数-1)例如:0110 1101转为十进制的过程为1*2^0+0*2^1+1*2^2+1*2^3+0*2^4+1*2^5+1*2^6+0*2^7=109
int a=0b01101101,b=0;for(i =0;i<8;i++){if(a&(1<b+=(1<}
0*2^7+1*2^6+1*2^5+0*2^4+1*2^3+1*2^2+0*2^1+1*2^0