10.10.2013, 03:21
bin2dec
pawn Код:
bin2dec(n[]) {
static c, l, j;
c = 0;
for(l = strlen(n) - 1, j = l ; j > -1 ; j--) {
if(n[j] == '1') c += (1 << (l-j));
}
return c;
}