Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sub fib(Int $n where $n >= 0) returns Int {
- if $n == 0 {
- return 0;
- } elsif $n == 1 {
- return 1;
- }
- fib($n - 1) + fib($n - 2);
- }
- fib(10) == 55 or die "Wrong number";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement