projects
/
testub10.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
673e43cda08d74b47191f47c830808a35b4b641b
[testub10.git]
/
gesamt
/
codeb_georg_fib_025.0
1
/* fibonacci */
2
3
/* F_0 = 0 */
4
/* F_1 = 1 */
5
/* F_n = F_{n-1} + F_{n-2} */
6
7
method fib(x)
8
var a := 0;
9
var b := 1;
10
if x < 2 then return x; end;
11
while not (x < 2)
12
do
13
var A := a;
14
a := b;
15
b := A-(0-b);
16
x := x-1;
17
end;
18
return b;
19
end;