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>

static int has_fib[44];
static int fib[44];

int fibonacci(int n) {
    if (has_fib[n] == 1) {
        return fib[n];
    }
    fib[n] = fibonacci(n - 1) + fibonacci(n - 2);
    has_fib[n] = 1;
    return fib[n];
}

int main() {
    int N;
    fib[0] = 1;
    has_fib[0] = 1;
    fib[1] = 1;
    has_fib[1] = 1;
    std::cin >> N;
    std::cout << fibonacci(N) << std::endl;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i=0;i < (int)(n);i++)

int fib[50];

int f(int x){
    
    if (fib[x] != 0) return fib[x];
    else{
        return fib[x]=f(x-1)+f(x-2);
    }
}

int main(){
    fib[0]=1;
    fib[1]=1;
    int n;
    cin >> n;
    cout << f(n) << endl;   
    return 0;
}

C++: ///
// File:  alds1_10_a.cpp
// Author: ymiyamoto
//
// Created on Tue Oct 17 00:57:42 2017
//

#include <cstdint>
#include <iostream>

using namespace std;
#define SIZE 100
static uint64_t mem[SIZE];

uint64_t fib(uint32_t n)
{
  if (n == 0) {
    return mem[0] = 1;
  } else if (n == 1) {
    return mem[1] = 1;
  } else {
    uint64_t n1, n2;

    if (mem[n - 2] == 0) {
      n2 = mem[n - 2] = fib(n - 2);
    } else {
      n2 = mem[n - 2];
    }

    if (mem[n - 1] == 0) {
      n1 = mem[n - 1] = fib(n - 1);
    } else {
      n1 = mem[n - 1];
    }
    return n1 + n2;
  }
}

int32_t main()
{
  uint32_t n;
  cin >> n;

  cout << fib(n) << endl;
  return 0;
}

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

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

C++: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define FORD(i,a,b) for(int i=a;i>=b;i--)
#define ALL(a)  (a).begin(),(a).end()
#define SZ(a) int((a).size())
#define SORT(c) sort((c).begin(),(c).end())
#define MEMSET(v, h) memset((v), h, sizeof(v))
#define sqr(x) ((x) * (x))
#define bit(n) (1LL<<(n))
#define pcnt(x) __builtin_popcountll(x)
#define PB push_back
#define MP make_pair
#define endl "\n"
using Edge = pair<int,int>;
using Graph = vector<vector<Edge>>;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
// ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
// ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

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

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

int main() {
    int n;    cin >> n;
    int F[50];
    F[0] = F[1] = 1;
    for ( int i = 2; i <= n; i++ ) { F[i] = F[i - 1] + F[i - 2]; }

    cout << F[n] << endl;

    return 0;
}

C++: #include <iostream>

using namespace std;


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

}

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

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i,n,x) for(int i=n;i<x;i++)

const int MAX_N = 50;

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

    int F[MAX_N];
    F[0] = F[1] = 1;
    rep(i, 2, n+1) F[i] = F[i-1] + F[i-2];

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

C++: #include <iostream>
using namespace std;
#define ll long long int
ll fib[1000];
ll fibonacci(ll n)
{
    if(fib[n])
        return fib[n];
    if (n<=1)
        return n;
    return fib[n] = fibonacci(n-2) + fibonacci(n-1);
}
int main ()
{
    int a;
    cin>>a;
    cout<<fibonacci(a+1)<<endl;

}

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

int main() {
	int n;
	cin >> n;
	int ans = 0;
	vector<int> fib = { 1,1 };
	if (n == 0) {
		cout << 1 << endl;
		return 0;
	}
	else if (n == 1) {
		cout << 1 << endl;
		return 0;
	}
	for (int i = 2; i <= n; i++) {
		fib.push_back(fib.at(i - 1) + fib.at(i - 2));
	}

	cout << fib.at(n) << endl;
}

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

int fib(int n){
    if(n==0)    return 1;
    else if(n==1)   return 1;
    else    return fib(n-1)+fib(n-2);
}

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

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

int fibonacci(int* dp, int i, int n)
{
    // メモ化再帰
    if(n == 1) return 1;
    if(i == 0 || i == 1){
        dp[i] = 1;
        return fibonacci(dp, i+1, n);
    }
    dp[i] = dp[i-1] + dp[i-2];
    if(i >= n) return dp[i];
    return fibonacci(dp, i+1, n);
}

int fibonacci2(int n)
{
    // DP
    int dp[50];
    dp[0] = dp[1] = 1;
    for(int i=2;i<=n; ++i)
    {
        dp[i] = dp[i-1] + dp[i-2];
    }
    return dp[n];
}

int main()
{
    int n;
    int dp[50];
    cin >> n;
    cout << fibonacci2(n) << endl;
}

C++: #include<iostream>

using namespace std;

int A[45] = {};
int B[45];

int fib(int n);

int main() {
	
	int n;
	
	while(cin >> n) {
		
		for(int i=0;i<n;i++)
			B[i] = 0;
		
		cout << fib(n) << "\n";
		
	}

	return 0;
}

int fib(int n) {
	
	A[0] == A[1] == 1;
	
	if(n == 0 || n == 1) 
		return 1;
	
	else if(B[n])
		return A[n];
		
	else {
		A[n] = fib(n-1) + fib(n-2);
		B[n] = 1;
		return A[n];
}

}

C++: #include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int INF = 1e9;

int main()
{
  vector<ll> dp(50, 1);
  int n = 0;
  fscanf(stdin, "%d", &n);
  for (int i = 2; i <= n; ++i) {
    dp[i] = dp[i - 2] + dp[i - 1];
  }
  fprintf(stdout, "%lld\n", dp[n]);
  return 0;
}

C++: #include <stdio.h>
#define N 100
#define M -1
int fib(int);

int array[N];
int main()
{
  int i,n;
  scanf("%d",&n);
  for(i=0;i<N;i++)
    {
      array[i]=M;
    }
  printf("%d\n",fib(n));
}

int fib(int x)
{
  if(x==0&&x==1)
    {
      array[x]=1;
      return array[x];
    }
  else if(array[x]!=M) return array[x];
  else
    {
      array[x]=(fib(x-2)+fib(x-1));
    }
}