projects
/
testub10.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
[gesamt] Added and adopted Testcases from SS09
[testub10.git]
/
gesamt
/
codeb_georg_fib_028.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
11
then
12
return x;
13
end;
14
while not (x < 2)
15
do
16
var A := a;
17
a := b;
18
b := 0-b;
19
b := A-b;
20
x := x-1;
21
end;
22
return b;
23
end;