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<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int) (n); i++)
using namespace std;

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

C++: #include <iostream>

static int has_fib[44];
static int fib[44];

int fibonacci(int n) {
    if (has_fib[n] == 1) {
        return fib[n];
    }
    fib[n] = fibonacci(n - 1) + fibonacci(n - 2);
    has_fib[n] = 1;
    return fib[n];
}

int main() {
    int N;
    fib[0] = 1;
    has_fib[0] = 1;
    fib[1] = 1;
    has_fib[1] = 1;
    std::cin >> N;
    std::cout << fibonacci(N) << std::endl;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i=0;i < (int)(n);i++)

int fib[50];

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

int main(){
    fib[0]=1;
    fib[1]=1;
    int n;
    cin >> n;
    cout << f(n) << endl;   
    return 0;
}

C++: ///
// File:  alds1_10_a.cpp
// Author: ymiyamoto
//
// Created on Tue Oct 17 00:57:42 2017
//

#include <cstdint>
#include <iostream>

using namespace std;
#define SIZE 100
static uint64_t mem[SIZE];

uint64_t fib(uint32_t n)
{
  if (n == 0) {
    return mem[0] = 1;
  } else if (n == 1) {
    return mem[1] = 1;
  } else {
    uint64_t n1, n2;

    if (mem[n - 2] == 0) {
      n2 = mem[n - 2] = fib(n - 2);
    } else {
      n2 = mem[n - 2];
    }

    if (mem[n - 1] == 0) {
      n1 = mem[n - 1] = fib(n - 1);
    } else {
      n1 = mem[n - 1];
    }
    return n1 + n2;
  }
}

int32_t main()
{
  uint32_t n;
  cin >> n;

  cout << fib(n) << endl;
  return 0;
}

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

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

C++: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define FORD(i,a,b) for(int i=a;i>=b;i--)
#define ALL(a)  (a).begin(),(a).end()
#define SZ(a) int((a).size())
#define SORT(c) sort((c).begin(),(c).end())
#define MEMSET(v, h) memset((v), h, sizeof(v))
#define sqr(x) ((x) * (x))
#define bit(n) (1LL<<(n))
#define pcnt(x) __builtin_popcountll(x)
#define PB push_back
#define MP make_pair
#define endl "\n"
using Edge = pair<int,int>;
using Graph = vector<vector<Edge>>;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
// 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;}

int main() {
  int dp[50];
  dp[0] = 1; dp[1] = 1;
  FOR(i,2,44){
    dp[i] = dp[i-2] + dp[i-1];
  }
  int n; cin >> n;
  cout << dp[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 fib(int n){
  if(n<0){
    return 0;
  }
  if(n==1||n==2){
    return 0
  }
  return fib(n-1)+fib(n-2);

}

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

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

const int MAX_N = 50;

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

    int F[MAX_N];
    F[0] = F[1] = 1;
    rep(i, 2, n+1) F[i] = F[i-1] + F[i-2];

    cout << F[n] <<endl;
    
    return 0;
}

C++: #include <iostream>
using namespace std;
#define ll long long int
ll fib[1000];
ll fibonacci(ll n)
{
    if(fib[n])
        return fib[n];
    if (n<=1)
        return n;
    return fib[n] = fibonacci(n-2) + fibonacci(n-1);
}
int main ()
{
    int a;
    cin>>a;
    cout<<fibonacci(a+1)<<endl;

}

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

int main() {
	int n;
	cin >> n;
	int ans = 0;
	vector<int> fib = { 1,1 };
	if (n == 0) {
		cout << 1 << endl;
		return 0;
	}
	else if (n == 1) {
		cout << 1 << endl;
		return 0;
	}
	for (int i = 2; i <= n; i++) {
		fib.push_back(fib.at(i - 1) + fib.at(i - 2));
	}

	cout << fib.at(n) << endl;
}

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

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

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

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

int fibonacci(int* dp, int i, int n)
{
    // メモ化再帰
    if(n == 1) return 1;
    if(i == 0 || i == 1){
        dp[i] = 1;
        return fibonacci(dp, i+1, n);
    }
    dp[i] = dp[i-1] + dp[i-2];
    if(i >= n) return dp[i];
    return fibonacci(dp, i+1, n);
}

int fibonacci2(int n)
{
    // DP
    int dp[50];
    dp[0] = dp[1] = 1;
    for(int i=2;i<=n; ++i)
    {
        dp[i] = dp[i-1] + dp[i-2];
    }
    return dp[n];
}

int main()
{
    int n;
    int dp[50];
    cin >> n;
    cout << fibonacci2(n) << endl;
}

C++: #include<iostream>

using namespace std;

int A[45] = {};
int B[45];

int fib(int n);

int main() {
	
	int n;
	
	while(cin >> n) {
		
		for(int i=0;i<n;i++)
			B[i] = 0;
		
		cout << fib(n) << "\n";
		
	}

	return 0;
}

int fib(int n) {
	
	A[0] == A[1] == 1;
	
	if(n == 0 || n == 1) 
		return 1;
	
	else if(B[n])
		return A[n];
		
	else {
		A[n] = fib(n-1) + fib(n-2);
		B[n] = 1;
		return A[n];
}

}

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

using namespace std;

typedef long long ll;

const int INF = 1e9;

int main()
{
  vector<ll> dp(50, 1);
  int n = 0;
  fscanf(stdin, "%d", &n);
  for (int i = 2; i <= n; ++i) {
    dp[i] = dp[i - 2] + dp[i - 1];
  }
  fprintf(stdout, "%lld\n", dp[n]);
  return 0;
}