This commit is contained in:
parent
d73eb9b5b2
commit
b4486bf603
@ -6,7 +6,7 @@ class Program {
|
||||
string $r = '';
|
||||
for(int $i = 1; $n >= 0 && $i < 10; $i++) {
|
||||
$r = chr(0x41 + ($n % pow(26, $i) / pow(26, $i - 1))) + $r;
|
||||
$n -= pow(26, $i);
|
||||
$n -= (int)pow(26, $i);
|
||||
}
|
||||
return $r;
|
||||
}
|
||||
@ -15,7 +15,7 @@ class Program {
|
||||
int $r = 0;
|
||||
int $l = strlen($a);
|
||||
for(int $i = 0; $i < $l; $i++) {
|
||||
$r += pow(26, $i) * (ord($a[$l - $i - 1]) - 0x40);
|
||||
$r += (int)pow(26, $i) * (ord($a[$l - $i - 1]) - 0x40);
|
||||
}
|
||||
return (int) $r - 1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user