Warum so kompliziert?
Delphi-Quellcode:
function fibonacci(Index : Integer) : Int64;
Begin
Case Index of
1, 2 : Result := 1;
Else Result := fibonacci(Index-2) + fibonacci(Index-1);
End;
End;
PS: Rekursion is was Feines!
//Edit: Integer in Int64 geändert.
Axel Sefranek
A programmer started to cuss, cause getting to sleep was a fuss.
As he lay there in bed, looping round in his head
was: while(!asleep()) ++sheep;