Go: package main

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

// I/O
type Scanner struct {
	sc *bufio.Scanner
}

func NewScanner() *Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &Scanner{sc}
}

func (s *Scanner) nextStr() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *Scanner) nextInt() int {
	i, e := strconv.Atoi(s.nextStr())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *Scanner) nextFloat() float64 {
	f, e := strconv.ParseFloat(s.nextStr(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *Scanner) nextRuneSlice() []rune {
	return []rune(s.nextStr())
}

func (s *Scanner) nextIntSlice(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextInt()
	}
	return res
}

func (s *Scanner) nextFloatSlice(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextFloat()
	}
	return res
}

// Arithmetic
func max(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m < i {
			m = i
		}
	}
	return m
}

func min(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m > i {
			m = i
		}
	}
	return m
}

func abs(x int) int {
	if x > 0 {
		return x
	}
	return -x
}

func pow(x, y int) int {
	res := 1
	for i := 0; i < y; i++ {
		res *= x
	}
	return res
}

func ceil(a, b int) int {
	if a%b == 0 {
		return a / b
	} else {
		return a/b + 1
	}
}

// Sort
type RuneSlice []rune

func (a RuneSlice) Len() int           { return len(a) }
func (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }
func (a RuneSlice) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

// Main
func main() {
	sc := NewScanner()
	wtr := bufio.NewWriter(os.Stdout)
	N := sc.nextInt()
	dp := make([]int, N+1)
	dp[0] = 1
	dp[1] = 1
	for i := 2; i <= N; i++ {
		dp[i] = dp[i-1] + dp[i-2]
	}

	fmt.Fprintln(wtr, dp[N])
	wtr.Flush()
}

C++: #include <functional>
#include <iostream>
#include <vector>

using namespace std;

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

    vector<int> memo(n + 1, -1);
    function<int(int)> f = [&memo, &f](int nn) -> int {
        if (memo[nn] != -1) {
            return memo[nn];
        }
        else if (nn == 0) {
            memo[nn] = 1;
        }
        else if (nn == 1) {
            memo[nn] = 1;
        }
        else {
            memo[nn] = f(nn - 1) + f(nn - 2);
        }
        return memo[nn];
    };

    cout << f(n) << endl;
}

C++: #include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep1(i, n) for (int i = 1; i < (n); ++i)
using namespace std;
typedef long long ll;

map<int, ll> memo;

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

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

    int n;
    cin >> n;

    memo[1] = 1;
    memo[0] = 1;
    cout << fib(n) << endl;

    return 0;
}

C++: #include <iostream>

using namespace std;

long long F[50];

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

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

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

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

int main(int argc,char* argv[]){
  int a=1,b=1,x,n;
  cin>>n;
  if(n==1)
    cout<<1<<endl;
  else{
    for(int i=2;i<=n;i++){
      x=a+b;
      a=b;
      b=x;
    }
    cout<<x<<endl;
  }
  return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int n,dp[45]={1,1};
  cin >> n;
  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;
typedef long long ll;
#define mod 1000000007
#define MAX 50

ll fib(int n);

ll dp[MAX];

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

ll fib(int n){
    if(dp[n] != -1) return dp[n];

    dp[n] = fib(n-1) + fib(n-2);
    return dp[n];

}

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

int result[44];

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

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

C++: #include<stdio.h>

int fib(int);

int main()
{
  int a,n;

  scanf("%d",&n);

  a = fib(n);
  printf("%d\n",a);

  return 0;
}

int fib(int n){

  int a;
  
  if(n==0 || n==1){
    return 1;
  }

  a = fib(n-1)+fib(n-2);

  return a;
}