Go: package main

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

var (
	nstr   func() string
	stdout *bufio.Writer
)

func init() {
	nstr = newReadString(os.Stdin)
	stdout = bufio.NewWriter(os.Stdout)
}

func main() {
	defer stdout.Flush()
	n := nint()
	r := fibonacci(n)
	fmt.Println(r)
}

func fibonacci(n int) int{
	if n == 0 || n == 1{
		return 1
	}else{
		fiList := make([]int, n+1)
		fiList[0] = 1
		fiList[1] = 1
		for i:=2; i<n+1; i++{
			fiList[i] = fiList[i-1] + fiList[i-2]
		}
		return fiList[n]

	}

}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

func nint64() int64 {
	i, err := strconv.ParseInt(nstr(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func nint() int {
	return int(nint64())
}

func getIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = nint()
	}
	return b
}

func getStringSlice(n int) []string {
	b := make([]string, n)
	for i := 0; i < n; i++ {
		b[i] = nstr()
	}
	return b
}

func gcd(x, y int) int {
	if y == 0 {
		return x
	}
	return gcd(y, x%y)
}

func lcm(x, y int) int {
	return x * y / gcd(x, y)
}

func contains(s []int, e int) bool {
	for _, a := range s {
		if a == e {
			return true
		}
	}
	return false
}

func bin(i int, prefix bool) string {
	i64 := int64(i)

	if prefix {
		return "0b" + strconv.FormatInt(i64, 2)
	} else {
		return strconv.FormatInt(i64, 2)
	}
}

func strReverse(s string) string {
	runes := []rune(s)
	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
		runes[i], runes[j] = runes[j], runes[i]
	}

	return string(runes)
}

C++: #include <iostream>

using namespace std;

#define MAX 45
int array[MAX];

void setNumber(int n) {
  array[0] = 1;
  array[1] = 1;
  for(int i = 2; i < n + 1; i++) {
    array[i] = array[i - 1] + array[i - 2];
  }
}


int main(void) {
  int n;
  cin >> n;

  setNumber(n);
  cout << array[n] << endl;

  return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<(b);i++)
#define erep(i,a,b) for(int i=a;i<=(int)(b);i++)
#define per(i,a,b) for(int i=(b)-1;i>(a);i--)
#define eper(i,a,b) for(int i=((int)(a));i>=b;i--)
#define pb push_back
#define mp make_pair
#define INF (1<<30)-1
#define MOD 1000000007
using namespace std;
typedef long long ll;
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
int gcd(int a,int b){return b?gcd(b,a%b):a;}

int n;
int fib(int x) {
    if (x == 0) return 1;
    if (x == 1) return 1;
    return fib(x-1) + fib(x-2);
}
int main() {
 ios::sync_with_stdio ( false );
 cin.tie ( 0 );
    cin >> n;
    cout << fib(n) << endl;
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;

int dp[50];

int fib(int n){
    if(n == 0 || n == 1) return dp[n] = 1;
    if(dp[n] != -1) return dp[n];
    return dp[n] = fib(n-1) + fib(n-2);
}

int main(){
    int n;
    for(int i = 0; i < 50; i++) dp[i] = -1;
    cin >> n;
    cout << fib(n) << endl;
}

C++: import numpy as np
import sys
f = [-1 for i in range(45)]
f[0] = f[1] = 1

def fib(n):
    global f
    for i in range(2,n+1):
        f[i] = f[i - 1] + f[i - 2]
        #print(i,f[i])
    return f[n]

if __name__ == "__main__":
    n = input("input number: ")
    n = int(n)
    #print(type(n))
    print(fib(n))

C++: #include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <complex>
#include <ctime>
#include <cstdlib>

using namespace std;

inline int to_int(string s) {int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string to_str(T x) {ostringstream sout; sout << x; return sout.str();}

typedef long long ll;

int main()
{
	int fib[1256], num;

	fib[0] = 1; fib[1] = 1;

	for(int i = 2; i < 128; i++)
	{
		fib[i] = fib[i-1] + fib[i-2];
	}
	cin >> num;

	cout << fib[num] << endl;
}

C++: #include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
int A[50];
int fib(int n){
	if(n==1 || n==0) A[n]=1;
	
	else if(A[n]) ;
	else A[n]=fib(n-1)+fib(n-2);
	return A[n];
}

int main (){
	int n;
	cin>>n;
	cout<<fib(n)<<endl;
	return 0;
}

C++: #include<iostream>

using namespace std;

int main() {
  int N;
  cin >> N;

  int F[50];

  F[0] = F[1],
  for (int i = 2; i <= N; i++) {
    F[i] = F[i - 1] + F[i - 2];
  }

  cout << F[N] << endl;

  return 0;
}

C++: //
// Created by miyoshi on 2019/05/23.
//

#include <iostream>

using namespace std;

int N[45];


int f(int n) {
    if (N[n] != 0) {
        return N[n];
    }
    else if (n==0 || n==1) {
        return 1;
    } else {
        return f(n-1) + f(n-2);
    }
}

int main() {
    int n;
    cin >> n;

    for (int i=0; i <= n; i++) {
        N[i] = 0;
    }

    for (int i=0; i <= n; i++) {
        N[i] = f(i);
    }

    cout << N[n] << endl;
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main() {
   int n;
   cin >> n;
   int A[n];
   if (n==1) cout << 1 << endl;
   else if (n==2) cout << 2 << endl;
   else {
       A[0]=1;
       A[1]=2;
       for (int i=2; i<n; i++) {
           A[i]=A[i-1]+A[i-2];
       }
       cout << A[n-1] << endl;
   }
}

C++: #include <iostream>

using namespace std;
int d[45];
int main(){
    int n;
    cin>>n;
    d[0]=d[1]=1;
    for(int i=2;i<=n;i++){
        d[i]=d[i-1]+d[i-2];
    }
    cout<<d[n]<<endl;
    return 0;
}

C++: #include <iostream>
#include <cstring>
#include <cstdlib>
#include <sstream>
#include <stack>
#include <queue>
#include <list>
#include <stdio.h>
#include <algorithm>
#define MAX 100000
using namespace std;
typedef long long ll;
int dp[50];
int main()
{	
	int n;
	cin>>n;
	dp[0]=dp[1]=1;
	for(int i=2;i<=n;i++) dp[i]=dp[i-1]+dp[i-2];
	cout<<dp[n]<<endl;
	return 0;
}

C++: #include "bits/stdc++.h"

using namespace std;

int main (){
	int n;
	cin >> n;
	int a[44];
	a[0] = 1;
	a[1] = 1;
	for (int i = 2;i<=n;i++){
		a[i] = a[i - 1] + a[i - 2];
	}
	cout << a[n - 1]<<endl;


	return 0;
}

C++: #include <iostream>
#include <vector>
using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int> dp(n + 1);
    dp[1] = 1;
    dp[0] = 1;
    for (int i = 2; i <= n; i++)
        dp[i] = dp[i - 1] + dp[i - 2];
    cout << dp[n] << endl;
}

C++: #include<algorithm>
#include<iostream>
using namespace std;

int fib[44],n;
int main() {
  fib[0] = 1;
  fib[1] = 1;
  for (int i = 1; i <= 44; ++i) {
	if (i >= 2) fib[i] = fib[i-1] + fib[i-2];
	}
	cin >> n;
	cout << fib[n] << endl;
	}

C++: #include<iostream>
using namespace std;

int Fibonacci(int n)
{
	if (n == 0 || n == 1) return 1;
	return Fibonacci(n - 1) + Fibonacci(n - 2);
}

int main()
{
	int n;
	cin >> n;
	cout << Fibonacci(n) << endl;
	return 0;
}

C++: #include<iostream>
using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);

	int n, N[50];
	N[0] = N[1] = 1;
	cin >> n;

	for (int i = 2; i <= n; i++)
		N[i] = N[i - 1] + N[i - 2];

	cout << N[n];
	return 0;
}

C++: //
// Created by Sotetsu KOYAMADA on 2020/03/02.
//

#include <iostream>
#include <vector>

int fib(int n, std::vector<int> &dp) {
    if (n == 0) return 1;
    if (n == 1) return 1;
    if (dp[n] != -1) return dp[n];
    return dp[n] = fib(n - 1, dp) + fib(n - 2, dp);
}

int main() {
    int n;
    std::cin >> n;
    std::vector<int> dp(n+1, -1);
    std::cout << fib(n, dp) << std::endl;
}