Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 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