Go: package main

/*
フィボナッチ数列
*/

import (
	"bufio"
	"bytes"
	"fmt"
	"log"
	"os"
	"strconv"
	"strings"
)

func fibWithMemo(n int, memo map[int]int) int {
	if n == 0 || n == 1 {
		return 1
	}
	if val, ok := memo[n]; ok {
		return val
	}
	memo[n] = fibWithMemo(n-1, memo) + fibWithMemo(n-2, memo)
	return memo[n]
}

func fib(n int) int {
	memo := make(map[int]int)
	return fibWithMemo(n, memo)
}

func main() {
	scanner := makeScanner(1024)
	n := eGetInt(scanner)
	fmt.Println(fib(n))
}

////////////////////////////////////////////////////////////////////////////////
// ライブラリ
////////////////////////////////////////////////////////////////////////////////
func makeScanner(maxByte int) *bufio.Scanner {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Buffer(make([]uint8, 0, 8192), maxByte)
	return scanner
}
func makeWordScanner() *bufio.Scanner {
	scanner := makeScanner(8192)
	scanner.Split(bufio.ScanWords)
	return scanner
}
func eGetLine(r *bufio.Scanner) string {
	if r.Scan() {
		return r.Text()
	}
	err := r.Err()
	if err != nil {
		log.Fatal(err)
	}
	// EOF
	return ""
}
func eGetInt(r *bufio.Scanner) int {
	line := eGetLine(r)
	return eAtoi(line)
}
func eGetFields(r *bufio.Scanner) []string {
	line := eGetLine(r)
	return strings.Fields(line)
}
func eGetInts(r *bufio.Scanner) []int {
	fields := eGetFields(r)
	ints := make([]int, len(fields))
	for i := 0; i < len(ints); i++ {
		ints[i] = eAtoi(fields[i])
	}
	return ints
}
func eGetChars(r *bufio.Scanner) []string {
	line := eGetLine(r)
	return strings.Split(line, "")
}
func eAtoi(s string) int {
	n, err := strconv.Atoi(s)
	if err != nil {
		log.Fatal(err)
	}
	return n
}

type ints []int

func (s ints) String() string {
	var buf bytes.Buffer
	buf.WriteString("[")
	sep := ""
	for _, v := range s {
		buf.WriteString(fmt.Sprintf("%s%d", sep, v))
		sep = ", "
	}
	buf.WriteString("]")
	return buf.String()
}

func reverse(a ints) ints {
	r := make(ints, len(a))
	for i := 0; i < len(a); i++ {
		r[i] = a[len(a)-1-i]
	}
	return r
}
func max(a ints) (int, bool) {
	if len(a) == 0 {
		return 0, false
	}
	m := a[0]
	for _, e := range a {
		if e > m {
			m = e
		}
	}
	return m, true
}
func min(a []int) int {
	m := a[0]
	for _, v := range a {
		if v < m {
			m = v
		}
	}
	return m
}

func sum(a ints) int {
	if len(a) == 0 {
		return 0
	}
	sum := 0
	for _, e := range a {
		sum += e
	}
	return sum
}
func find(n int, a ints) int {
	for i, v := range a {
		if n == v {
			return i
		}
	}
	return -1
}

C++: #include <stdio.h>
long long fiboDP(int n){
    long long fibodp[200]={0};
    fibodp[1]=1;
    fibodp[2]=1;
    for(int i=3;i<=n;i++){
        fibodp[i]=fibodp[i-1]+fibodp[i-2];
    }
    return fibodp[n];
}
int main(void){
    int n;
    scanf("%d",&n);
    printf("%lld\n",fiboDP(n+1));
   return 0;
}

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

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, i;
	for (i = 0; i < 50; i++) dp[i] = -1;

	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];

  dp[0]=1;
  dp[1]=1;
  cin >> n;

  for (int i= 2;i<= n; i++){
    dp[i]=dp[i-1]+dp[i-2];
  }

  cout << dp[n]<< endl;

  return 0;
}

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

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

C++: #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep2(i,n) for(int i=1;i<=(n);i++)
#define rep3(i,i0,n) for(int i=i0;i<(n);i++)
#define pb push_back
#define mod 1000000007
const ll INF = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { 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;}
#define all(x) x.begin(), x.end()
#define mp make_pair
bool compare(pair<int, int> a, pair<int, int> b) {
    if(a.first != b.first){
        return a.first < b.first;
        
    }else{
        return a.second < b.second;
    }
}


bool In_map(ll y,ll x,ll h,ll w){
    if(y<0 || x<0 || y>=h || x>=w){
        return 0;
    }else{
        return 1;
    }
}
const vector<ll> dx{1,0,-1,0};
const vector<ll> dy{0,1,0,-1};
int main() {
    ll N;
    cin >> N;
    
    vector<ll> dp(N+1);
    dp[0] = 1;
    dp[1] = 1;
    rep3(i,2,N+1){
        dp[i] = dp[i-1] + dp[i-2];
    }

       
    cout << dp[N] << endl;



    return 0;
    

}

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

int main()
{
	int n,x1=1,x2=1,tmp=0;
	cin >> n;
	
	if(n==0||n==1) cout << "1";
	else{
		for(;n>2;n--){
			tmp=x1+x2;
			x1=x2;
			x2=tmp;
		}
		cout << x1 + x2;
	}
	
	return 0;
	
}

C++: #include <iostream>
using namespace std;
int main(){
    int n,a[100];
    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<stdio>
#include<stream>
using namespace std;

int fibo(int x) {
  int a;
  if ( x == 0 ) return 1;
  if ( x == 1 ) return 1;
  a = fibo(x-1) + fibo(x-2);
  return a;
}

int main() {
  int x, y;

  cin >> x;

  y = fibo(x);

  cout << y << endl;

  return 0;
}

C++: #include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define Lower_bound(v, x) \
  distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) \
  distance(v.begin(), upper_bound(v.begin(), v.end(), x))

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;
using T = tuple<ll, ll, ll>;
using vll = vector<ll>;
using vP = vector<P>;
using vT = vector<T>;
using vvll = vector<vector<ll>>;
using vvP = vector<vector<P>>;
using dqll = deque<ll>;

ll dx[9] = {-1, 1, 0, 0, -1, -1, 1, 1, 0};
ll dy[9] = {0, 0, -1, 1, -1, 1, -1, 1, 0};

const ll INF = 1LL << 50;

const ll mod = 1e9 + 7;

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

  if (n <= 1) {
    puts("1");
    return 0;
  }

  ll fn = 2;
  ll fn1 = 1, fn2 = 1;
  rep(i, n - 2) tie(fn, fn1, fn2) = T(fn + fn1, fn, fn1);
  cout << fn << endl;

  return 0;
}

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

unsigned long long ull[45];

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

C++: #include<iostream>

using namespace std;
int fib(int n);
int memo[45];
int main() {
  int n;

  //入力
  cin >> n;

  //出力
  cout << fib(n) << endl;

  return 0;
}

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