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_021.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
if x < 2 then return x; end;
9
var a := 0;
10
var b := 1;
11
var c := x;
12
while not (x < 2)
13
do
14
c := a-(0-b);
15
a := b;
16
b := c;
17
x := x-1;
18
end;
19
return c;
20
end;