GitLab Commit is coming up on August 3-4. Learn how to innovate together using GitLab, the DevOps platform. Register for free: gitlabcommitvirtual2021.com

fibonacci_recursivo.gs 221 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
def fibonacci(n: int): int
	if n < 2 do
		return n
	else
		return fibonacci(n - 1) + fibonacci(n - 2)

init
	var numero = 10
	var resultado = fibonacci(numero)
kenkeiras's avatar
kenkeiras committed
10
	print "Elemento nº %i de fibonacci: %i", numero, resultado