Fibonacci sequence in AerScript implementation.
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2019-06-14 22:52:02 +02:00
parent 010bdd7331
commit aff19a98da
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,19 @@
class Program {
private int fib(int $n) {
int $last = 0;
int $cur = 1;
--$n;
while($n > 0) {
--$n;
int $tmp = $cur;
$cur = $last + $cur;
$last = $tmp;
}
return $cur;
}
public int main() {
var_dump($this->fib(43));
}
}

View File

@ -0,0 +1 @@
int(433494437)