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 <vector>
using namespace std;


void fibonacci(int n){
  vector<int> fib;

  fib.push_back(1);
  fib.push_back(1);

  if(n < 2){
    cout << "1" << endl;
  }else if(n == 2){
    fib.push_back(fib.at(0) + fib.at(1));
    cout << fib.back() << endl;
  }else{
    for(int i = 2;i < n+1;i++){
      fib.push_back(fib.at(i - 2) + fib.at(i - 1));
    }
      cout << fib.back() << endl;
  }

}

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

  return 0;
}

C++: #include<iostream>
using namespace std;
int a[10005];
int main()
{
    int n;
    cin>>n;
    a[0]=a[1]=1;
    for(int i=2;i<=n;i++)
        {
            a[i]=a[i-1]+a[i-2];
        }
    cout<<a[n]<<endl;
    return 0;
}

C++: #include <iostream>
#include <string>
#include <cmath>
using namespace std;
long long int S[200010];


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


int main(void){
    // Your code here!
    long long int N,H,W,i,j,k,ans,count,cost,tmp;
    
    long long int Ssum[200010];
    string T;
    bool flag;
    count=0;
    ans=0;
    flag=false;
    cin >>N;
    S[0]=1;
    S[1]=1;
    
    for (i=2;i<1000;i++){
        S[i]=-1;
    } 
    
    ans = fib(N);

    cout<< ans <<endl;
    

    return 0;
    
}

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

int fib(int n, int a, int b);

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


int fib(int n, int a, int b){
	if (n != 0){
		fib(n - 1, a + b, a);
  }
	return (a);
}

C++: #include<cstdio>
#include<cstdlib>
#include<iostream>
using namespace std;
// 0 -> 1
// 1 -> 1
// 2 -> 2
// 3 -> 3
int main() {
  int n;
  int dp[44] = {};
  cin >> n;
  dp[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 "bits/stdc++.h"
using namespace std;
int d;
int dd[50];
int fib(int a){
	if(a==0||a==1)return dd[a]=1;
	if(dd[a]!=-1)return dd[a];
	return fib(a-1)+fib(a-2);
}

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

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

C++: #include <iostream>

using namespace std;

int fib(int n) {
    int a = 1;
    int b = 1;

    for (int i = 0; i < n-1; ++i) {
        int tmp = a;
        a = b;
        b += tmp;
    }
    return b;
}

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

    cout << fib(n) << endl;

    return 0;
}

C++: #include <stdio.h>

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

C++: #include <iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;
    long long fib[50];
    fib[0]=1; fib[1]=1;
    for (int i=2; i<=n; i++) fib[i]=fib[i-1]+fib[i-2];
    cout<<fib[n]<<'\n';
    return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <deque>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
#include <complex>
using namespace std;

using ll = long long;
using ull = uint64_t;
using P = pair<int, int>;
constexpr double EPS = 1e-9;
constexpr int INF = 1001001001;
constexpr int mod = 1000000007;
// constexpr int mod = 998244353;

template<class T>
inline bool chmax(T& x, T y){
    if(x < y){
        x = y;
        return true;
    }
    return false;
}
template<class T>
inline bool chmin(T& x, T y){
    if(x > y){
        x = y;
        return true;
    }
    return false;
}

constexpr int dx[4] = {1, -1, 0, 0};
constexpr int dy[4] = {0, 0, 1, -1};

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

    int n;
    cin >> n;
    vector<ll> dp(n + 1, -1);
    auto MemoRec = [&](auto&& self, int N) -> ll {
        if(dp[N] != -1) return dp[N];
        if(N <= 1)  return dp[N] = 1;
        return dp[N] = self(self, N - 1) + self(self, N - 2);
    };
    cout << MemoRec(MemoRec, n) << endl;
}

C++: #include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for(int i = int(a); i < int(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
const long long INFLL = 1LL << 60;
const int INFINT = 1 << 30;
const long long MOD = 1e9 + 7;

template <class T> void vecout(T V) {
    auto t = V.begin();
    *t++;
    while(t != V.end()) {
        cout << " " << *t++;
        // if(t != V.end()) cout << " ";
    }
    cout << endl;
};

ll fib[100] = {0};
ll solve(int i) {
    if(fib[i] > 0) return fib[i];
    if(i < 2) return 1;
    return fib[i] = solve(i - 1) + solve(i - 2);
}

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

    int n;
    cin >> n;
    cout << solve(n) << endl;
}

C++: /*
** 斐波那契数列 使用动态规划来避免重复的计算
*/

# include <cstdio>
# include <cstring>

const int MAX = 44 + 5;

int n, dp[MAX];

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

void solve() {
    scanf("%d", &n);
    memset(dp, 0, sizeof(dp));
    printf("%d\n", fib(n));
}

int main() {
    // freopen("infile", "r", stdin);
    // freopen("outfile", "w", stdout);
    solve();
    return 0;
}

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

long long f[10000000];

long long fib(int n)
{
  if (n == 0 || n == 1) return (1);
  if (f[n] != 0)  return (f[n]);
  else {
    f[n] = fib(n - 1) + fib(n - 2);
  }
  return f[n];
}
int main()
{
  int n;
  cin >> n;
  cout << fib(n) << endl;
}