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 <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <cstdlib>
using namespace std;

const int MAX = 55;
int n;
int dp[MAX];

int solve(int n) {
    if (dp[n] != -1) return dp[n];
    return dp[n] = (solve(n-1) + solve(n-2));
}

int main() {
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    memset(dp, -1, sizeof(dp));
    dp[0] = 1;
    dp[1] = 1;
    scanf("%d", &n);
    printf("%d\n", solve(n));
    return 0;
}

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

const int MAX = 44;
int F[MAX];

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

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <string>
#include <cstdio>
#include <queue>
#include <list>
using namespace std;

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

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

  cout << fibonacci(n) << endl;

  return 0;
}

C++: #include <iostream>
#include <cstdio>

using namespace std;

long long fib[45];

int main(void) {

    int n;
    cin >> n;

    fib[0] = fib[1] = 1;
    for (int i = 2; i <= n; ++i) {
        fib[i] = fib[i - 1] + fib[i - 2];
    }

    printf("%lld\n", fib[n]);

    return 0;
}

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

const int MAX_N = 44;

int main() {
    vector<int> fib(MAX_N + 1);
    fib[0] = 1;
    fib[1] = 1;
    for(int i = 2; i <= MAX_N; i++) fib[i] = fib[i - 1] + fib[i - 2];
    int N; cin >> N;
    cout << fib[N] << endl;
}

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

int F[MAX];

void Fibonacci(){
  F[0] = 0; F[1] = 1;
  for( int i = 2 ; i < MAX ; i++ ) F[i] = F[i-2] + F[i-1];
}

int main(void){
  Fibonacci();
  int i;

  cin >> i;
  cout << F[i] << endl;

  return 0;
}

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

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

C++: #include<stdio.h>
#include<algorithm>
#include<string.h>
using namespace std;
#define NIL -2000000001
#define MAX 2000

int A[MAX];
int n = 0;

int fib(int num) {
  if (A[num] != NIL) {
    return A[num];
  } else {
    return fib(num-1)+fib(num-2);
  }
}

int main() {
  int num;
  for ( int i = 0; i < MAX; i++ ) {
    A[i] = NIL;
  }
  A[0] = 1;
  A[1] = 1;
  scanf("%d", &num);
  printf("%d\n", fib(num));
  return 0;
}

C++: #include <bits/stdc++.h>
       
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

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

  vector<int> fib(n + 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>
using namespace std;

int n;
int F[45];
int fibo(int i) {
    if (F[i]) {
        return F[i];
    }
    return fibo(i - 1) + fibo(i-2);
}

int main() {
    cin >> n;
    F[0] = F[1] = 1;
    cout << fibo(n) << endl;

    return 0;
}

C++: #include <bits/stdc++.h>
#include <iostream>
#include <math.h>
using namespace std;
map<int, int>dp;
int fib(int N) {
   if (N == 0 || N == 1) {
       return 1;
   } else if (dp.count(N) > 0) {
        return dp[N];
    }

    int ans = fib(N-1) + fib(N-2);
    dp[N] = ans;
    return ans;
}
int main() {
    int N;
    cin >> N;
    dp[0] = 1;
    dp[1] = 1;
    cout << fib(N) << endl;
    return 0;
}

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;
long long fibo(int n){
    int F[n];
    F[0] = F[1] = 1;
	for(int i = 2; i <= n; i++)
        F[i] = F[i-1]+F[i-2];
	return F[n];
}

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

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

int dp[50];

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

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

}

C++: #include <bits/stdc++.h>
#define rep(i, n) for (int i=0; i<(n); ++i)
#define repr(i, a, b) for (int i=a; i<(b); ++i)
#define reprev(i, n) for (int i=n-1; i>=0; --i)
#define reprrev(i, a, b) for (int i=b-1; i>=(a); --i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
    cout << fixed << setprecision(10);
    
    int n; cin >> n;
    vector<int> fib(n+1);
    fib[0] = 1; fib[1] = 1;
    repr(i, 2, n+1) {
        fib[i] = fib[i-2] + fib[i-1];
    }
    cout << fib[n] << endl;
    return 0;
}