Go: package main

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

//util
var sc = bufio.NewScanner(os.Stdin)

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

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func printList(list []int) {
	buf := bufio.NewWriter(os.Stdout)
	for _, v := range list {
		buf.Write([]byte(fmt.Sprintf(" %d", v)))
	}
	buf.Write([]byte("\n"))
	buf.Flush()
}

//solve
//単純な場合
func fibonacci_(n int) int {
	if n == 0 || n == 1 {
		return 1
	}
	return fibonacci_(n-2) + fibonacci_(n-1)
}

//メモ再帰の利用
func fibonacci(n int) int {
	if n == 0 || n == 1 {
		F[n] = 1
	}
	//F[n]が計算済みの場合
	if F[n] > 0 {
		return F[n]
	}
	F[n] = fibonacci(n-2) + fibonacci(n-1)
	return F[n]
}

const MAX = 50

var F [MAX]int

func main() {
	sc.Split(bufio.ScanWords)
	n := nextInt()
	fmt.Println(fibonacci(n))

}

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

using namespace std;

void solve()
{
	vector<int> fibo;
	fibo.push_back(1);
	fibo.push_back(1);
	for (int i = 2; i <= 44; ++i)
	{
		fibo.push_back(fibo[i - 1] + fibo[i - 2]);
	}
	int n;
	cin >> n;
	cout << fibo[n] << endl;
}

int main()
{
	solve();
	return(0);
}

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

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

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

int main() {
	int N;
	cin >> N;
	if( N >= 2){
		vector<unsigned> f;
		f.push_back(1);
		f.push_back(1);
		for(int i = 2; i <= N; i++){
			int temp = f.at(i-1) + f.at(i-2);
			f.push_back(temp);
		}
		cout << f.at(N) << endl;;
	}else{
		cout << 1 << endl;
	}
	
	return 0;
}

C++: #include <bits/stdc++.h>
#define REP(i,n) for(int i=0; i<n; ++i)
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define F first
#define S second
#define PB push_back
#define MP make_pair 
using namespace std;
typedef unsigned long ul;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vii;
typedef pair<int, int> pi;
const int INF = 100100100;
const unsigned int MOD = 1000000007;

bool is_prime(int n) { for (int i = 2; i*i <= n; ++i) { if (n % i == 0) return false; } return true; }
template<class T> inline void chmin(T& a, T b) { if (a > b) { a = b; } }
template<class T> inline void chmax(T& a, T b) { if (a < b) { a = b; } }

ll dp[50];
int N;

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

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


int fib(int n , int t , int p1 , int p2){

  if( n==t )return p1+p2;

  return fib(n+1,t,p2,p1+p2);
  
}


int main(){

  int n;

  cin >> n;

  if(n==0 || n==1)cout << 1 << endl;
  else
    cout << fib(2,n,1,1) << endl;

  return 0;
}

C++: #include <stack>
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
using namespace std;
int gcd(int a, int b)
{
   if (a%b == 0)
   {
       return(b);
   }
   else
   {
       return(gcd(b, a%b));
   }
}
int mod = 1000000000 + 7;
int lcs(string x, string y){
    
    int m = x.size();
    int n = y.size();
    int c[m+1][n+1];
    int Max = 0;
    string X = " " + x;
    string Y = " " + y;
    for(int j = 0; j <= m; j++){
        c[j][0] = 0;
    }
    for(int j = 1; j <= n; j++){
        c[0][j] = 0;
    }
    for(int i = 1; i <= m; i++){
        for(int j = 1; j <= n; j++){
            if(X[i] == Y[j]){
                c[i][j] = c[i-1][j-1] + 1;
            }else{
                c[i][j] = max(c[i-1][j], c[i][j-1]);
            }
            Max = max(Max, c[i][j]);
        }
    }
    
    return Max;
}
int main(){
    //std::stack<int> stack;
    
    int n;
    cin >> n;
    vector<int> fib(45);
    fib[0] = 1;
    fib[1] = 1;
    for(int i = 2; i < 45; i++){
        fib[i] = fib[i-1] + fib[i-2];
    }
    cout << fib[n] << endl;
}

C++: #include <iostream>

using namespace std;

int main() {

    int fib[50];
    fib[0] = fib[1] = 1;

    for (int i = 2; i <= 44; ++i) fib[i] = fib[i-1] + fib[i-2];

    int n;
    cin >> n;

    cout << fib[n] << endl;

    return 0;
}

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

int fib(int n);

vector<long long> fib_n(100, 0);

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

int fib(int n) {
  if (fib_n[0] == 0) {

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

C++: #include <iostream>
#include <cstdio>
using namespace std;
int fib(int n){
  if(n==0) return 1;
  if(n==1) return 1;
  return fib(n-1)+fib(n-2);
}

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