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"
#include "algorithm"
#include "string"
using namespace std;

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

C++: #include <stdio.h>
#define MAX 45

int F[MAX];

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

int main(void){
  int n, f;
  scanf("%d", &n);
  for(int i=0; i<=n; i++){
    F[i] = -1;
  }
  f = fibonacci(n);
  printf("%d\n", f);
  return 0;
}

C++: #include <cstdio>

int fib(int *a,int n){
    if(n==0 || n==1)return 1;
    else{
        int tmp;
        if(a[n])tmp = a[n];
        else{
            tmp = fib(a,n-1) + fib(a,n-2);
            a[n] = tmp;
        }
        return tmp;
    }
}

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

C++: #include<iostream>

using namespace std;

int fib(int n);

int memo[45];

int main() {
  int n;

  //入力
  cin >> n;

  //出力
  cout << fib(n) << endl;

  return 0;
}

int fib(int n){

  if(n == 0) {
    return 1;
  }else if(n == 1){
    return 1;
  }else if(memo[n] != 0){
    return memo[n];
  }else{
    return fib(n-1) + fib(n-2);
  }
}

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

int main(){
  int n,f[45];
  cin >> n;
  f[0]=1;
  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>
#define ll long long
#define rep(i, n) for(int i=0;i<(n);++i)
#define per(i, n) for(int i=(n)-1;i>=0;--i)
#define repa(i, n) for(int i=1;i<(n);++i)
#define foreach(i, n) for(auto &i:(n))
#define pii pair<int, int>
#define pll pair<long long, long long>
#define all(x) (x).begin(), (x).end()
#define bit(x) (1ll << (x))
const ll MOD = (ll)1e9+7;
const int INF = (ll)1e9+7;
const ll INFLL = (ll)1e18;
using namespace std;
template<class t>
using vvector = vector<vector<t>>;
template<class t>
using vvvector = vector<vector<vector<t>>>;
template<class t>
using priority_queuer = priority_queue<t, vector<t>, greater<t>>;
template<class t, class u> bool chmax(t &a, u b){if(a<b){a=b;return true;}return false;}
template<class t, class u> bool chmin(t &a, u b){if(a>b){a=b;return true;}return false;}

ll modpow(ll x, ll b){
	ll res = 1;
	while(b){
		if(b&1)res = res * x % MOD;
		x = x * x % MOD;
		b>>=1;
	}
	return res;
}

ll modinv(ll x){
	return modpow(x, MOD-2);
} 

ll fibonacci(int x){
	if(x<=1)return 1;
	static vector<ll> memo(45, -1);
	if(memo[x]>=0)return memo[x];
	return memo[x] = fibonacci(x-1) + fibonacci(x-2);
}

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

C++: #include <iostream>
#include<algorithm>
#include<stack>
#include<string>
#include<cstdlib>
#include<stdio.h>
using namespace std;
int n,a[50];
int solve(int i){
    if(i==1||i==0)return 1;
    return solve(i-1)+solve(i-2);
}
int main(){
    int n;
    cin>>n;
    cout<<solve(n)<<endl;
    return 0;
}

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

constexpr int inf = 1e9;
constexpr ll linf = 1e18;

template <typename T>
class Matrix
{
public:
    Matrix(int n, int m)
        : m_value(n, vector<T>(m, 0)), m_row(n), m_col(m) {}
    Matrix(initializer_list<initializer_list<T>> init)
        : m_value(init.begin(), init.end()), m_row(init.size()), m_col((*init.begin()).size()) {}

    int row(void) const { return m_row; }
    int col(void) const { return m_col; }

    vector<T> &operator[](int i) { return m_value[i]; }
    const vector<T> &operator[](int i) const { return m_value[i]; }

    // 単位行列E
    static Matrix E(int n)
    {
        Matrix res(n, n);
        for (int i = 0; i < n; i++) res[i][i] = 1;
        return res;
    }

    Matrix &operator+=(const Matrix &A)
    {
        int n = this->row(), m = this->col();
        assert(n == A.row() && m == A.col());

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                (*this)[i][j] += A[i][j];
            }
        } 
        return *this;
    }

    Matrix &operator-=(const Matrix &A)
    {
        int n = this->row(), m = this->col();
        assert(n == A.row() && m == A.col());

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                (*this)[i][j] -= A[i][j];
            }
        } 
        return *this;
    }

    Matrix &operator*=(const Matrix &A)
    {
        int n = this->row(), m = this->col(), l = A.col();
        assert(m == A.row());

        Matrix res(n, l);
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < l; j++) {
                for (int k = 0; k < m; k++) {
                    res[i][j] += (*this)[i][k] * A[k][j];
                }
            }
        }
        return *this = move(res);
    }

    Matrix operator+(const Matrix &A) const { return Matrix(*this) += A; }
    Matrix operator-(const Matrix &A) const { return Matrix(*this) -= A; }
    Matrix operator*(const Matrix &A) const { return Matrix(*this) *= A; }

    Matrix pow(ll n) const
    {
        Matrix e = *this, res = E(this->row());
        while (n) {
            if (n & 1) res *= e;
            e *= e;
            n >>= 1;
        }
        return res;
    }

    friend ostream &operator<<(ostream &os, const Matrix &A)
    {
        int n = A.row(), m = A.col();
        for (int i = 0; i < n; i++) {
            os << "[";
            for (int j = 0; j < m; j++) {
                os << A[i][j];
                if (j < m - 1) os << ", ";
            }
            os << "]";
            if (i < n - 1) os << endl;
        }
        return os;
    }

private:
    vector<vector<T>> m_value;
    size_t m_row;
    size_t m_col;
};

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

    int n; cin >> n;
    Matrix<ll> A = {{1, 1}, {1, 0}};
    A = A.pow(n);
    cout << A[1][0] + A[1][1] << endl;
    return 0;
}