Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Scan()
	num, _ := strconv.Atoi(sc.Text())

	fmt.Println(fibonacci(num))
}

func fibonacci(num int) int {
	fibs := make([]int, num+1)

	for i := range fibs {
		if i <= 1 {
			fibs[i] = 1
		} else {
			fibs[i] = fibs[i-1] + fibs[i-2]
		}
	}

	return fibs[num]
}

Python: n = int(input())
p = [1,1]

if n <= 1:
    print (1)
    exit (0)

for i in range(2,n+1):
    p.append(p[i-2] + p[i-1])

print (p[n])

Python: n = int(input())

num = [-1] * 100


def fibonacci(n):
    if n == 0:
        num[0] = 1
    elif n == 1:
        num[1] = 1

    if num[n] == -1:
        num[n] = fibonacci(n - 1) + fibonacci(n - 2)

    return num[n]


print(fibonacci(n))

Python: l = [0 for i in range(45)]
l[0] = 1
l[1] = 1
def F(n):
    if l[n] != 0:
        return l[n]
    else:
        l[n] = F(n-1) + F(n-2)
        return l[n]
print(F(int(input())))

Python: num = int(input())

dp = { 0: 1, 1: 1 }
def fibonacci(n):
  if not n in dp:
    dp[n] = fibonacci(n - 1) + fibonacci(n - 2)
  return dp[n]

print(fibonacci(num))