Thema: Delphi Fibonachi - Aufrufbaum

Einzelnen Beitrag anzeigen

Benutzerbild von 3_of_8
3_of_8

Registriert seit: 22. Mär 2005
Ort: Dingolfing
4.129 Beiträge
 
Turbo Delphi für Win32
 
#5

Re: Fibonachi - Aufrufbaum

  Alt 10. Mai 2007, 19:07
Na geh das doch einfach selbst durch.

function FIB( i : longint ) : longint // Für i = 5 einsetzen
if i <= 2
then result := 1
else result := FIB( i - 1 ) + FIB( i - 2 );
end;

FIB(5)
FIB(4) FIB(3)
FIB(3) FIB(2) FIB(2) FIB(1)
FIB(2) FIB(1)
Manuel Eberl
„The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it.“
- Terry Pratchett
  Mit Zitat antworten Zitat