Go: package main

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

// I/O
type Scanner struct {
	sc *bufio.Scanner
}

func NewScanner() *Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &Scanner{sc}
}

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

func (s *Scanner) nextInt() int {
	i, e := strconv.Atoi(s.nextStr())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *Scanner) nextFloat() float64 {
	f, e := strconv.ParseFloat(s.nextStr(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *Scanner) nextRuneSlice() []rune {
	return []rune(s.nextStr())
}

func (s *Scanner) nextIntSlice(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextInt()
	}
	return res
}

func (s *Scanner) nextFloatSlice(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextFloat()
	}
	return res
}

// Arithmetic
func max(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m < i {
			m = i
		}
	}
	return m
}

func min(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m > i {
			m = i
		}
	}
	return m
}

func abs(x int) int {
	if x > 0 {
		return x
	}
	return -x
}

func pow(x, y int) int {
	res := 1
	for i := 0; i < y; i++ {
		res *= x
	}
	return res
}

func ceil(a, b int) int {
	if a%b == 0 {
		return a / b
	} else {
		return a/b + 1
	}
}

// Sort
type RuneSlice []rune

func (a RuneSlice) Len() int           { return len(a) }
func (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }
func (a RuneSlice) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

// Main
func main() {
	sc := NewScanner()
	wtr := bufio.NewWriter(os.Stdout)
	N := sc.nextInt()
	dp := make([]int, N+1)
	dp[0] = 1
	dp[1] = 1
	for i := 2; i <= N; i++ {
		dp[i] = dp[i-1] + dp[i-2]
	}

	fmt.Fprintln(wtr, dp[N])
	wtr.Flush()
}

C++: #include<iostream>

using namespace std;

unsigned long memo[50] = {};

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

	cin >> n;

	cout << fib(n) << endl;

	return 0;
}

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

using namespace std;

int fiv(int a[], int n){
    if(a[n])return a[n];
    if(n == 0)return a[n] = 1;
    if(n == 1)return a[n] = 1;
    return a[n] = fiv(a, n-1) + fiv(a, n-2);
}

int main(void){
    int n;
    cin >> n;
    int a[n+1];
    for(int i = 0; i <= n; i++)a[i] = 0;
    fiv(a, n);
    cout << a[n] << endl;
}

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

int F[10000];

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

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

C++: #include<bits/stdc++.h>
using namespace std;
long long fib[100];
long long fibonacci(long long n)
{
    if(fib[n])
        return fib[n];
    if(n<=1) return n;
    return fib[n]=fibonacci(n-2)+fibonacci(n-1);
}

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

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

// macro
#define rep(i,n) for(i=0;i<n;i++)
#define ll long long
#define all(v) v.begin(), v.end()

// code starts
int main()
{
  int n;cin>>n;
  int i;
  vector<int> dp(n+1);
  dp[0]=1;
  dp[1]=1;
  rep(i,n-1)dp[i+2]=dp[i+1]+dp[i];
  cout<<dp[n]<<endl;
}

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

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

void init()
{
    for (int i = 0; i < MAX; i++) {
        fibo_res[i] = -1;
    }
}

int fibonacci(int n)
{
    if (n == 0 || n == 1) {
        return 1;
    }
    if (fibo_res[n-1] != -1 && fibo_res[n-2] != -1) {
        return fibo_res[n-1] + fibo_res[n-2];
    } else {
        int res = fibonacci(n-1) + fibonacci(n-2);
        fibo_res[n] = res;
        return res;
    }
}

int main(int argc, char *argv[])
{
    init();
    int n;
    scanf("%d", &n);
    fprintf(stdout, "%d\n", fibonacci(n));
}

C++: #include <bits/stdc++.h>
using namespace std;
template<typename T>
ostream& operator<<(ostream& os, const vector<T>& v){
  const char* dlm = "";
  for(const auto& x:v) cout << exchange(dlm, "\t") << x;
  return os;
}
int32_t main(){
  size_t n; cin>>n;
  size_t f[45];
  f[0]=1; f[1]=1;
  for(size_t i=2; i<45; ++i) f[i]=f[i-1]+f[i-2];
  cout<<f[n]<<endl;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define lper(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define ins insert
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
using vpl=vector<pl>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={1,0,-1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
ll modfac(ll a){
    ll ans=1;
    while(a>1){
        ans*=a;
        ans%=1000000007;
        a--;
    }
    return ans;
}
ll modinv(ll a,ll m) {
    ll b = m, u = 1, v = 0;
    while (b) {
        ll t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m; 
    if (u < 0) u += m;
    return u;
}
struct UnionFind {
    vector<int> par;
    
    UnionFind(int n) : par(n, -1) {}

    int root(int x) {
        if (par[x] < 0) return x;
        else return par[x] = root(par[x]);
    }
    
    bool same(int x, int y) {
        return root(x) == root(y);
    }
    
    bool merge(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (par[x] > par[y]) swap(x, y);
        par[x] += par[y];
        par[y] = x;
        return true;
    }
    
    int size(int x) {
        return -par[root(x)];
    }
};
ll modpow(ll a, ll n, ll mod) {
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
int main(){
    ll n;cin >> n;
    vl dp(45,0);
    dp[0]=1;
    dp[1]=1;
    rep(i,43){
        dp[i+2]=dp[i+1]+dp[i];
    }
    cout << dp[n] <<endl;
}

C++: #include <iostream>
using namespace std;
static const int MAX = 45;
int F[MAX];

int fib(int n)
{
    if (F[n] != 0) return F[n];
    if (n == 0) F[n] = 1;
    if (n == 1) F[n] = 1;
    if (n >= 2) F[n] = fib(n-2) + fib(n-1);
    return F[n];
}

int main()
{
    for (int i = 0; i != MAX; ++i)
    {
        F[i] = 0;
    }
    int n;
    cin >> n;
    cout << fib(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 */
      dp[i]=dp[i-1]+dp[i-2];
    }

    //??????
    cout << dp[n] << endl;

    return 0;
}

C++: 
f = [-1 for i in range(45)]
f[0] = f[1] = 1

def fib(n):
    global f
    for i in range(2,n+1):
        f[i] = f[i - 1] + f[i - 2]
        #print(i,f[i])
    return f[n]

if __name__ == "__main__":
    n = input("input number: ")
    n = int(n)
    #print(type(n))
    print(fib(n))

C++: #include <bits/stdc++.h>
using namespace std;
long long memo[50];
long long f(long long x){
  if(x==0||x==1)return memo[x]=1;
  if(memo[x]!=0)return memo[x];
  return memo[x]=f(x-1)+f(x-2);
}
int main() {
  int n;
  cin >>n;
  long long kotae=f(n);
  cout<<kotae<<endl;
}