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;

int memo[100];

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

int main() {
    int n;
    cin >> n;
    fill(memo, memo + 100, -1);
    cout << fibonacci(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 <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
int A[50];
int fib(int n){
	if(n==1 || n==0) A[n]=1;
	else A[n]=fib(n-1)+fib(n-2);
	return A[n];
}

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

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

int main(int argc, char* argv[]) {
    int n;
    int F[MAX+1];
    cin >> n;
    F[0] = 1;
    F[1] = 1;
    for (int i = 2; i <= n; i++){
        F[i] = F[i-2] + F[i-1];
    }
    cout << F[n] << "\n";
    return 0;
}

C++: #include <iostream>

using namespace std;

#define MAX 45
int array[MAX];

void setNumber(int n) {
  array[0] = 1;
  array[1] = 1;
  for(int i = 2; i < n + 1; i++) {
    array[i] = array[i - 1] + array[i - 2];
  }
}


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

  setNumber(n);
  cout << array[n] << endl;

  return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<(b);i++)
#define erep(i,a,b) for(int i=a;i<=(int)(b);i++)
#define per(i,a,b) for(int i=(b)-1;i>(a);i--)
#define eper(i,a,b) for(int i=((int)(a));i>=b;i--)
#define pb push_back
#define mp make_pair
#define INF (1<<30)-1
#define MOD 1000000007
using namespace std;
typedef long long ll;
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
int gcd(int a,int b){return b?gcd(b,a%b):a;}

int n;
int fib(int x) {
    if (x == 0) return 1;
    if (x == 1) return 1;
    return fib(x-1) + fib(x-2);
}
int main() {
 ios::sync_with_stdio ( false );
 cin.tie ( 0 );
    cin >> n;
    cout << fib(n) << endl;
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;

int dp[50];

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

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

C++: import numpy as np
import sys
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 <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <complex>
#include <ctime>
#include <cstdlib>

using namespace std;

inline int to_int(string s) {int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string to_str(T x) {ostringstream sout; sout << x; return sout.str();}

typedef long long ll;

int main()
{
	int fib[1256], num;

	fib[0] = 1; fib[1] = 1;

	for(int i = 2; i < 128; i++)
	{
		fib[i] = fib[i-1] + fib[i-2];
	}
	cin >> num;

	cout << fib[num] << endl;
}

C++: #include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
int A[50];
int fib(int n){
	if(n==1 || n==0) A[n]=1;
	
	else if(A[n]) ;
	else A[n]=fib(n-1)+fib(n-2);
	return A[n];
}

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

C++: #include<iostream>

using namespace std;

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

  int F[50];

  F[0] = F[1],
  for (int i = 2; i <= N; i++) {
    F[i] = F[i - 1] + F[i - 2];
  }

  cout << F[N] << endl;

  return 0;
}

C++: //
// Created by miyoshi on 2019/05/23.
//

#include <iostream>

using namespace std;

int N[45];


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

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

    for (int i=0; i <= n; i++) {
        N[i] = 0;
    }

    for (int i=0; i <= n; i++) {
        N[i] = f(i);
    }

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

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

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

C++: #include <iostream>

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

C++: #include <iostream>
#include <cstring>
#include <cstdlib>
#include <sstream>
#include <stack>
#include <queue>
#include <list>
#include <stdio.h>
#include <algorithm>
#define MAX 100000
using namespace std;
typedef long long ll;
int dp[50];
int main()
{	
	int n;
	cin>>n;
	dp[0]=dp[1]=1;
	for(int i=2;i<=n;i++) dp[i]=dp[i-1]+dp[i-2];
	cout<<dp[n]<<endl;
	return 0;
}

C++: #include "bits/stdc++.h"

using namespace std;

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


	return 0;
}

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

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