Tryag File Manager
Home
-
Turbo Force
Current Path :
/
home
/
cluster1
/
data
/
bu01
/
1121861
/
html
/
maxwell-old-archive
/
litprog-1.0
/
example
/
Upload File :
New :
File
Dir
/home/cluster1/data/bu01/1121861/html/maxwell-old-archive/litprog-1.0/example/fib.pl
#!/usr/bin/perl -w use strict; my $num = shift @ARGV || die; die "Not a number: $num\n" if $num !~ /^\d+$/; print "Fib($num) = ", &fib($num), "\n"; sub fib { my $n = shift; if ($n <= 2) { return 1; } else { return &fib($n-2) + &fib($n-1); } }