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++: #define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
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; }

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

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

C++: #include <iostream>

using namespace std;


int main()
{
    long fib[45];
    int n;
    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;
}

C++: #include <iostream>
#include <string>
#include <map>
#include <set>
using namespace std;
#define MAX 100000

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;

int fib(int n);

int main() {
    int n;
    int dp[45];

    //?????????
    /* ??????3-1 */
    dp[0]=1;
    /* ??????3-2 */
    dp[1]=1;
    //??\???
    cin >> n;

    //DP
    for (int i = 2; i <= n; i++) {
        /* ??????3-3 */
      d@[i]=dp[i-1]+dp[i-2];
    }

    //??????
    cout << dp[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>
#include<iomanip>
#include<cmath>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
const int inf=1e9+7;
const ll mod=1e9+7;

int DP[45];

void fibonacci(int n){
    if(DP[n-1]==0){
        fibonacci(n-1);
    }
    if(DP[n-2]==0){
        fibonacci(n-2);
    }
    DP[n] = DP[n-1] + DP[n-2];
}

int main() {
    int n;
    cin>>n;
    DP[0] = 1;
    DP[1] = 1;
    if(n>=2){
        fibonacci(n);
    }
    cout<<DP[n]<<endl;
}

C++: #include <iostream>
using namespace std;
long long dp[45];

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

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

C++: #include <iostream>

int F[45] = {1, 1};

int fib_recurse(int n) {
    if (n < 2) {
        return 1;
    }
    return fib_recurse(n - 1) + fib_recurse(n - 2);
}

int fib_memo(int n) {
    if (n < 2) {
        return F[n] = 1;
    }
    if (F[n]) return F[n];
    return F[n] = fib_memo(n - 1) + fib_memo(n - 2);
}

int fib_dp(int n) {
    if(n < 2) {
        return F[n];
    }
    for (int i = 2; i <= n; i++) {
        F[n] = F[i - 1] + F[i - 2];
    }
}

int main() {
    int n;
    std::cin >> n;
    std::cout << fib_memo(n) << std::endl;
    return 0;
}

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

template <class T> struct Matrix {
  vector<vector<T>> value;
  T init;

  Matrix(vector<vector<T>> vec,T init_) :init(init_), value(vec) {}
  Matrix(int h, int w, T init_) : init(init_) , value(h, vector<T>(w,init_)) {}

  Matrix<T> operator*(Matrix<T>& left) {
      Matrix<T> res(value.size(),left[0].size(),init);
      for(int i = 0;i < value.size();i++){
          for(int k = 0;k < left.size();k++){
              for(int j = 0;j < left[0].size();j++){
                  res[i][j] = (res[i][j] + value[i][k] * left[k][j]);
              }
          }
      }
      return res;
  }

  vector<T>& operator[](int n){
      return value[n];
  }

  size_t size(){
      return value.size();
  }

  Matrix<T> operator^(long long n){
      Matrix<T> a = *this;
      Matrix<T> res(a.size(),a.size(),init);
      for(int i = 0;i < a.size();i++){
          res[i][i] = 1;
      }

      while(n > 0){
          if(n & 1) res = res * a;
          a = a * a;
          n >>= 1;
      }
      return res;
  }
};



int main(){
    int n;
    cin >> n;
    Matrix<int> a({{1,1},{1,0}},0);
    cout << (a ^ (n + 1))[1][0] << endl;
}

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

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;

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;
int main(){
	int n, t, a = 1, b = 1;
	cin >> n;
	while (n-- > 1)
		t = a, a = b, b += t;
	cout << b << endl;
}

C++: #include <stdio.h>

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

int main()
{
    int n;
    scanf("%d",&n);
    int a[n+1];
    printf("%d\n",fib(a,n));
}

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

int fib(int n){
  if(n<=1)return n;
  return fib(n-1)+fib(n-2);
}

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