Go: package main

/*
フィボナッチ数列
*/

import (
	"bufio"
	"bytes"
	"fmt"
	"log"
	"os"
	"strconv"
	"strings"
)

func fibWithMemo(n int, memo map[int]int) int {
	if n == 0 || n == 1 {
		return 1
	}
	if val, ok := memo[n]; ok {
		return val
	}
	memo[n] = fibWithMemo(n-1, memo) + fibWithMemo(n-2, memo)
	return memo[n]
}

func fib(n int) int {
	memo := make(map[int]int)
	return fibWithMemo(n, memo)
}

func main() {
	scanner := makeScanner(1024)
	n := eGetInt(scanner)
	fmt.Println(fib(n))
}

////////////////////////////////////////////////////////////////////////////////
// ライブラリ
////////////////////////////////////////////////////////////////////////////////
func makeScanner(maxByte int) *bufio.Scanner {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Buffer(make([]uint8, 0, 8192), maxByte)
	return scanner
}
func makeWordScanner() *bufio.Scanner {
	scanner := makeScanner(8192)
	scanner.Split(bufio.ScanWords)
	return scanner
}
func eGetLine(r *bufio.Scanner) string {
	if r.Scan() {
		return r.Text()
	}
	err := r.Err()
	if err != nil {
		log.Fatal(err)
	}
	// EOF
	return ""
}
func eGetInt(r *bufio.Scanner) int {
	line := eGetLine(r)
	return eAtoi(line)
}
func eGetFields(r *bufio.Scanner) []string {
	line := eGetLine(r)
	return strings.Fields(line)
}
func eGetInts(r *bufio.Scanner) []int {
	fields := eGetFields(r)
	ints := make([]int, len(fields))
	for i := 0; i < len(ints); i++ {
		ints[i] = eAtoi(fields[i])
	}
	return ints
}
func eGetChars(r *bufio.Scanner) []string {
	line := eGetLine(r)
	return strings.Split(line, "")
}
func eAtoi(s string) int {
	n, err := strconv.Atoi(s)
	if err != nil {
		log.Fatal(err)
	}
	return n
}

type ints []int

func (s ints) String() string {
	var buf bytes.Buffer
	buf.WriteString("[")
	sep := ""
	for _, v := range s {
		buf.WriteString(fmt.Sprintf("%s%d", sep, v))
		sep = ", "
	}
	buf.WriteString("]")
	return buf.String()
}

func reverse(a ints) ints {
	r := make(ints, len(a))
	for i := 0; i < len(a); i++ {
		r[i] = a[len(a)-1-i]
	}
	return r
}
func max(a ints) (int, bool) {
	if len(a) == 0 {
		return 0, false
	}
	m := a[0]
	for _, e := range a {
		if e > m {
			m = e
		}
	}
	return m, true
}
func min(a []int) int {
	m := a[0]
	for _, v := range a {
		if v < m {
			m = v
		}
	}
	return m
}

func sum(a ints) int {
	if len(a) == 0 {
		return 0
	}
	sum := 0
	for _, e := range a {
		sum += e
	}
	return sum
}
func find(n int, a ints) int {
	for i, v := range a {
		if n == v {
			return i
		}
	}
	return -1
}

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


int main(){
	int n;
	scanf("%d", &n);
	int prev = 1;
	int prevprev = 1;
	int val;
	if (n == 0 || n == 1){
		val = 1;
	}
	else{
		for (int i = 1; i < n; i++){
			val = prev + prevprev;
			prevprev = prev;
			prev = val;
		}
	}
	printf("%d\n", val);

	return 0;
}

C++: #include<iostream>
using namespace std;
int dp[50];
int fibonacci(int x){
  if(x==0 || x==1) return 1;
  if(dp[x]!=0) return dp[x];
  return dp[x]=fibonacci(x-1)+fibonacci(x-2);
}
int main(){
  int n;
  cin>>n;
  cout<<fibonacci(n)<<endl;
  return 0;
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
#include<map>
#include<stack>
#include<queue>
#include<list>
using namespace std;
int inf = 1000000000;

int main(void) {

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

  return 0;
}

// EOF

C++: #include <stdio.h>

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

C++: #include <iostream>

int main()
{
	int n; std::cin >> n;
	
	long long int* DP = new long long int[n+1];
	DP[0] = DP[1] = 1;
	for (int i=2; i<=n; i++) DP[i] = DP[i-1] + DP[i-2];
	
	std::cout << DP[n] << std::endl;
	
	delete[] DP;
	
	return 0;
}

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

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

C++: #include <algorithm>
#include <cassert>
#include <climits>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <string>
#include <vector>

#define all(x) begin(x), end(x)

using namespace std;

template <typename T> T gcd(T a, T b) {
  if (a % b == 0) {
    return b;
  } else {
    return gcd(b, a % b);
  }
}

template <typename T> T lcm(T a, T b) { return a * b / gcd(a, b); }

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

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

C++: /*
    ????????°??§???????????¨????????????
*/

#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <limits.h>
#include <float.h>
#include <iostream>
#include <algorithm>
#include <string>
#include <iterator>
#include <vector>
#include <map>
#include <utility>
#define LLU unsigned long long int
#define LL long long int
#define LD long double
using namespace std;
#define Lfmax DBL_MAX
#define LLUmax ULLONG_MAX
#define LLmax LLONG_MAX
#define dmax INT_MAX
#define vd vector<int>
#define vLL vector<long long int>
#define vLLU vector<unsigned long long int> 
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
#define debug printf("asd\n")
#define debugd(a) printf("--%d\n",a)
#define debugdd(a,b) printf("--%d %d\n",a,b)
#define debugarr(a,b) for(int i=0 ; i<b ; i++)printf("%d ",a[i]);printf("\n")
#define newline printf("\n")
#define forin(a,b,c) for(int a=b ; a<c ; a++)
#define forde(a,b,c) for(int a=b ; a>=c ; a--)


inline void scd(int &a){scanf("%d",&a);}
inline void scdd(int &a,int &b){scanf("%d %d",&a,&b);}
inline void sctd(int &a,int &b,int &c){scanf("%d %d %d",&a,&b,&c);}
inline void scdlld(LL &a,LL &b){scanf("%I64d %I64d",&a,&b);}
inline void sclld(LL &a){scanf("%I64d",&a);}

#define scarrd(a,b) for(int index=0 ; index<b ; index++)scanf("%d",&a[index])
#define prdlld(a,b) printf("%I64d %I64d",a,b)
#define prdd(a,b) printf("%d %d",a,b)
#define prd(a) printf("%d",a)
#define prarr(a,b) for(int i=0 ; i<b ; i++)printf("%d ",a[i])
#define iniarr(a,b) for(int i=0 ; i<b ;i++)a[i]=0
#define arr(a,b) int *a=(int *)malloc(b*sizeof(int))
#define llarr(a,b) long long int *a=(long long int *)malloc(b*sizeof(long long int))
#define st(a,b) char *a=(char *)malloc(b*sizeof(char))
#define grav 9.8
#define pi 3.14159265

int fbc[200000];

int fb(int a)
{
	if(fbc[a]>0)
	return fbc[a];
	
	
	if(a<2)
	return 1;
	
	fbc[a]=fb(a-1)+fb(a-2);
	return fbc[a];
	
}

int main()
{
	iniarr(fbc,200000);
	int a;
	scd(a);
	printf("%d\n",fb(a));	
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
    vector<int> dp;
    dp.push_back(1),dp.push_back(1);
    for(int i=0;i<44;i++)dp.push_back(dp[i]+dp[i+1]);
    int N;scanf("%d",&N);
    printf("%d\n",dp[N]);
    return 0;
}

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

ll N, M, score=0;
vector<ll> Fib;

void dp(){
    for(int i=2;i<=N;i++) Fib[i] = Fib[i-1]+Fib[i-2];
}

signed main(){
    cin >> N;
    Fib.resize(N+1);
    Fib[0]=1;
    Fib[1]=1; 
    dp();
    cout << Fib[N] << endl;
    return 0;
}