fibonacci.alc 270 B

123456789101112
  1. include "primitives.alh"
  2. Integer function fib(param : Integer):
  3. if (integer_lte(param, 2)):
  4. return 1
  5. else:
  6. return integer_addition(fib(integer_subtraction(param, 1)), fib(integer_subtraction(param, 2)))
  7. Void function main():
  8. while(True):
  9. output(fib(input()))