first commit
This commit is contained in:
13
perl/Examples/Chap5/fib-0
Normal file
13
perl/Examples/Chap5/fib-0
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
###
|
||||
### fib0
|
||||
###
|
||||
|
||||
## Chapter 5 section 4.3.1
|
||||
|
||||
sub fib {
|
||||
my $n = shift;
|
||||
if ($n < 2) { return $n }
|
||||
fib($n-2) + fib($n-1);
|
||||
}
|
||||
Reference in New Issue
Block a user