Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
25
Task/Fibonacci-sequence/Aime/fibonacci-sequence.aime
Normal file
25
Task/Fibonacci-sequence/Aime/fibonacci-sequence.aime
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
integer
|
||||
fibs(integer n)
|
||||
{
|
||||
integer w;
|
||||
|
||||
if (n == 0) {
|
||||
w = 0;
|
||||
} elif (n == 1) {
|
||||
w = 1;
|
||||
} else {
|
||||
integer a, b, i;
|
||||
|
||||
i = 1;
|
||||
a = 0;
|
||||
b = 1;
|
||||
while (i < n) {
|
||||
w = a + b;
|
||||
a = b;
|
||||
b = w;
|
||||
i += 1;
|
||||
}
|
||||
}
|
||||
|
||||
return w;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue