summaryrefslogtreecommitdiff
path: root/regress/usr.bin/m4/fibo.pl
blob: c424dca18f432fd15a569126ed262952eb1a7032 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#! /usr/bin/perl
#	$OpenBSD: fibo.pl,v 1.2 2001/01/29 02:05:59 niklas Exp $

my $n=shift;

$fibo[0] = 'a';
$fibo[1] = 'b';
for (my $i = 2; $i <= $n; $i++) {
	$fibo[$i] = $fibo[$i-1].$fibo[$i-2];
}

print $fibo[$n], "\n";