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 <algorithm>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string>
#include <vector>
#include <cctype>
#include <cstdio>
#include <iomanip>
#include <functional>
#include <stack>
#define PI 3.1415926535
#define INF 114514810
#define FOR(i, r, n) for(int i=(r); i<(n); i++) 
#define REP(i, n) FOR(i, (0), n)

using namespace std;

long long int n;

long long int fib(int k){
	if (!k || k == 1) return 1;
	return fib(k - 1) + fib(k - 2);
}

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

C++: #include<bits/stdc++.h>
#define N 45
using namespace std;
int n,F[N];

int main(){
  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;
}

C++: #include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>

int fib(int* f, int n) {
    if (f[n] == 0) {
        f[n] = fib(f, n-1) + fib(f, n-2);
    }
    return f[n];
}

int main() {
    int n;
    std::cin >> n;
    int f[50] = {1, 1};

    std::cout << fib(f, n) << "\n";
    return 0;
}

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

int main(){
	int n;
	int ary[44] = { 1, 1 };

	cin >> n;

	for (int i = 2; i <= n; i++){
		ary[i] = ary[i - 1] + ary[i - 2];
	}
	
	cout << ary[n] << endl;
	
	return 0;
}

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

class Fib {
public:
    Fib(int n) : _data(n+1) {
        _data[0] = 1;
        _data[1] = 1;
    }

    int operator()(int n) {
        if (n <= _size) {
            return _data[n];
        }
        _data[n] = (*this)(n-1) + (*this)(n-2);
        _size = n;
        return _data[n];
    }

private:
    int _size = 1;
    vector<int> _data;
};


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

C++: #include<bits/stdc++.h>
#include<limits.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)

int main(){
    int n; cin >> n;
    int ans;
    if(n == 0 || n == 1){
        ans = 1;
    }else{
        int n_1 = 1;
        int n_2 = 1;
        for(int i = 2; i <= n; i++){
            ans = n_1 + n_2;
            n_2 = n_1;
            n_1 = ans;
        }
    }
    cout << ans << endl;
}

C++: #include <bits/stdc++.h>
#include<math.h>
#define rep(i,n) for (int i = 0; i < (n) ; ++i)
using namespace std;
using ll = long long ;
using P = pair<int, int> ;
#define PI 3.14159265358979323846264338327950
#define INF 100000000000000000

vector<int> f (45, -1) ;

int fib (int x){
    if(f[x] >= 0){
        return f[x] ;
    }
    if (x <= 1){
        return 1 ;
    }
    else {
        
        return f[x] = fib(x -1) + fib(x - 2) ;
    }

}

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

C++: #include <bits/stdc++.h>
using namespace std;
int dp[50];
int fib(int n){
if (n<=1) return 1;
if (dp[n]) return n;
return dp[n]=fib(n-1)+fib(n-2);
}
int main(){
int n; cin>>n; cout<<fib(n)<<endl;
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <utility>
#include <string>
#include <cmath>
#include <cstdlib>
#include <cstring>

using namespace std;

typedef uint64_t u64;
typedef int64_t s64;
typedef uint32_t u32;
typedef int32_t s32;
typedef vector<s32> vs32;
typedef vector<u32> vu32;
typedef vector<s64> vs64;
typedef vector<u64> vu64;

const double PI=3.14159265358979323846;

#define MAX(x, y) ((x) < (y) ? (y) : (x))
#define MIN(x, y) ((x) > (y) ? (y) : (x))

#define rep(i, N) for(int i = 0; i < N; ++i)

#define CEIL(x, y) (((x) + (y) - 1) / (y))
#define MOD 1000000007ULL

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

    int n;
    cin >> n;
    u64 f[n + 1];
    f[0] = f[1] = 1;
    rep (i, n - 1)
    {
        f[i + 2] = f[i + 1] + f[i];
    }

    cout << f[n] << "\n";
    return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
    int n, a[45] = { 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 <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define FOR(i,a,n) for(int i=(a); i<(n); i++)
#define all(v) v.begin(), v.end()
#define pb(v) push_back(v)
#define mp(x, y) make_pair(x, y)
#define fi first
#define se second
#define print(var)  do{ cout << #var << " : "; view(var); } while(0)
template<typename T> void view(T e){cout << e << endl;}
template<typename T> void view(const vector<T>& v){for(const auto& e : v){ cout << e << " "; } cout << endl;}
template<typename T> void view(const vector<vector<T> >& vv){ for(const auto& v : vv){ view(v); } }
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using P = pair<int ,int>;
using Graph = vector<vector<int>>;
const int INF = 1e9;
const int MOD = 1e9+7;

int memo[50];

int fib(int x) {
    if (x==0 || x==1) return 1;
    int ret1, ret2;
    ret1 = (memo[x-1]==-1) ? (fib(x-1)) : memo[x-1];
    ret2 = (memo[x-2]==-1) ? (fib(x-2)) : memo[x-2];
    memo[x-1] = ret1;
    memo[x-2] = ret2;
    return ret1+ret2;
}

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

    int n; cin >> n;
    rep(i, 50) memo[i] = -1;
    cout << fib(n) << endl;
}

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

C++: #include <bits/stdc++.h>
using namespace std;
int main() {
  int fib[100];
  fib[0] = 1;
  fib[1] = 1;
  for(int i = 2;i < 50;i++)fib[i] = fib[i-1] + fib[i-2];
  int n;
  cin >> n;
  cout << fib[n] << endl;
}

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

const int maxn = 50;

int n;
int a[maxn];

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

C++: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1e9 + 7;
const ll INF = 1LL << 60;
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define debug(x) cerr << #x << ": " << x << endl;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

int main() {
    ll n;
    cin >> n;
    ll fib[50];
    rep(i, n+1) {
        if(i == 0 || i == 1) fib[i] = 1;
        else fib[i] = fib[i-1] + fib[i-2];
    }
    cout << fib[n] << endl;
}

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

template <typename T>
T fib(int n){
    std::vector<T> fibs{1, 1}; // using C++11
    for (int i = 2; i <= n; i++){
        fibs.push_back(fibs[i - 2] + fibs[i - 1]);
    }
    return fibs[n];
}

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

C++: //By Vlgd
#include<bits/stdc++.h>
using namespace std;
int F[45]={0};
int f(int n){
	if (n==1||n==0) return F[n]=1;
	if (F[n]) return F[n];
	else return F[n]=f(n-1)+f(n-2);
}
main(){
	int n;scanf("%d",&n);
	printf("%d\n",f(n));
}