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

int makeFibonacci(int n) {
	int a[100];
	a[0] = 1;
	a[1] = 1;

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

	return a[n-1];
}


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

	int ans = makeFibonacci(n);

	cout << ans << endl;

	return 0;

}

C++: #include<iostream>
using namespace std;
int main() {
	int F[45];
	F[0] = 1;
	F[1] = 1;
	int n;
	cin >> n;
	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;
}

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

typedef long long int lli;

lli nlist[50];

int main(){
  int N;
  nlist[0]=nlist[1]=1;
  for(int i=2;i<50;i++) nlist[i]=nlist[i-1]+nlist[i-2];
  cin>>N;
  cout<<nlist[N]<<endl;
  return 0;
}

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

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

  int F[45];
  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 <vector>
#include <iostream>
using namespace std;
typedef vector<int> vec;
typedef vector<vec> mat;
typedef long long ll;
//A*Bの計算
mat mul(mat &A,mat &B){
	mat C(A.size(),vec(B[0].size()));
	for(int i =0;i <A.size();i++){
		for(int k =0;k <B.size();k++){
			for(int j =0;j <B[0].size();j++){
				C[i][j] =(C[i][j]+A[i][k]*B[k][j]);
			}
		}
	}
	return C;
}

//A^nの計算
mat pow(mat A,ll n){
	mat B(A.size(),vec(A.size()));
	for(int i =0;i <A.size();i++){
		B[i][i]=1;
	}
	while(n >0){
		if(n&1)B =mul(B,A);
		A =mul(A,A);
		n >>=1;
	}
	return B;
}


int main(){
	int n;
	cin>>n;
	mat A(2,vec(2));
	A[0][0]=1;
	A[0][1]=1;
	A[1][0]=1;
	A[1][1]=0;
	A =pow(A,n+1);
	cout <<A[1][0]<<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 <bits/stdc++.h>
using namespace std;

int dp[50];

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

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

C++: #include <cstdio>

const int MAX = 45;

int fib_num[MAX];

int fib(int n)
{
  if (fib_num[n] != 1)
    return fib_num[n];

  if (n == 0 || n == 1)
    return 1;
  else
    return fib_num[n] = fib(n - 1) + fib(n - 2);
}

int main()
{
  for (int i = 0; i < MAX; ++i)
    fib_num[i] = 1;

  int n;
  scanf("%d", &n);
  printf("%d\n", fib(n));

  return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef vector<ld> vd;
typedef vector<ll> vll;
typedef vector<string> vstr;
typedef vector<vector<ll>> vvll;
typedef vector<pair<ll, ll>> vpll;
typedef priority_queue<ll, vector<ll>, greater<ll>> spqll;  // 小さい順に取り出し
typedef priority_queue<ll, vector<ll>, less<ll>> bpqll;     // 大きい順に取り出し

#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define FOR(i, a, b) for (ll i = (ll)a; i < (ll)b; i++)
#define IREP(i, v) for (auto i = (v).begin(); i != (v).end(); i++)
#define FI first
#define SE second
#define MP make_pair
#define MT make_tuple
#define PB push_back
#define TS to_string
#define NP next_permutation
#define ALL(v) (v).begin(), (v).end()
#define SZ(x) (ll) x.size()
#define SP(x) setprecision((ll)x)


ll INF = 1e9;
ll NIL = -1;
ll MOD = 1000000007;
ll LINF = 1e18;
ld EPS = 1e-9;
ld PI = M_PI;
vll dx = {1, 0, -1, 0, 1, -1, -1, 1};
vll dy = {0, 1, 0, -1, 1, 1, -1, -1};
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a;} //最大公約数
ll lcm(ll a, ll b) { return a / gcd(a, b) * b;}     //最小公倍数

void yes(){ cout << "yes" << endl;}
void no(){ cout << "no" << endl;}

//-----------------------------------------

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

  int n;
  cin >> n;
  vll fib(100);
  fib[0] = 1;
  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<bits/stdc++.h>
using namespace std;

int main(){
	int n, F[45];
	cin >> n;
	
	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;
}