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<bits/stdc++.h>
using namespace std;

int main() {
    long long fib[50];
    fib[0] = 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] << "\n";
    return 0;
}

C++: #include <iostream>
#include <cstring>
#define Max 100
using namespace std;
int dp[Max];
int fib(int n){
    if(n==0 || n==1)
        return 1;
    if(dp[n]>0)
        return dp[n];
    else{
        dp[n]=fib(n-1)+fib(n-2);
        return dp[n];
    }
    
}

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

C++: #include <iostream>
#include <string>
#include <cstring>
#include <fstream>
#include <cmath>
#include <iomanip>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <map>
#include <deque>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <list>
#include <unordered_map>



using namespace std;

int main() {
   

    long long n;
    cin >> n;
    long long 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-1] << endl;


}

C++: #include <iostream>
using namespace	std;
int main(){

  int n,a[45],i;

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

  for(i=2;i<=n;i++) a[i]=a[i-2]+a[i-1];

  cout<<a[n]<<endl;

  return 0;

}

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

int fib(int n, int array[]) {
    array[0] = 1;
    array[1] = 1;
    for (int i= 2; i < n; i++) {
        array[i] = array[i - 1] + array[i - 2];
    }
}
int main(void) {
    
    cin >> num;
    int array[num] = {};
    fib(num, array);
    cout << array[num] << endl;


}

C++: // ALDS1_10_A.cpp
// Dynamic Programming - Fibonacci Number

#include <iostream>
using namespace std;

int fib(int n) {
    if (n == 0 || n == 1)
        return 1;
    int pre = 1;
    int curr = 1;
    int next = 1;
    while (n-- > 1) {
        next = pre + curr;
        pre = curr;
        curr = next;
    }
    return next;
}

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

C++: #include <iostream>

using namespace std;

#define INF -1

int dp[45];

int main()
{
	for(int i = 0; i < 45; i++) { dp[i] = INF; }

	int n;

	cin >> n;

	dp[0] = 1;
	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,d[50];
  d[0]=d[1]=1;
  for(int i=0;i<43;i++)d[i+2]=d[i]+d[i+1];
  cin>>n;
  cout<<d[n]<<endl;
  return 0;
}

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

#define rep(i, m, n) for(int(i) = (int)(m); i < (int)(n); ++i)
#define rep2(i, m, n) for(int(i) = (int)(n)-1; i >= (int)(m); --i)
#define REP(i, n) rep(i, 0, n)
#define REP2(i, n) rep2(i, 0, n)
#define all(hoge) (hoge).begin(), (hoge).end()
#define en '\n'
using ll = long long;
using ull = unsigned long long;
using ld = long double;
template <class T>
using vec = vector<T>;
template <class T>
using vvec = vector<vec<T>>;
typedef pair<ll, ll> P;
constexpr long long INF = 1LL << 60;
constexpr int INF_INT = 1 << 25;
constexpr long long MOD = (ll)1e9 + 7;
//constexpr long long MOD = 998244353LL;
using ld = long double;
static const ld pi = 3.141592653589793L;
typedef vector<ll> Array;
typedef vector<Array> Matrix;

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

struct Edge {
    ll to, rev;
    long double cap;
    Edge(ll _to, long double _cap, ll _rev) {
        to = _to;
        cap = _cap;
        rev = _rev;
    }
};
using Edges = vector<Edge>;
using Graph = vector<Edges>;

void add_edge(Graph &G, ll from, ll to, long double cap, bool revFlag,
              long double revCap) {
    G[from].push_back(Edge(to, cap, (ll)G[to].size()));
    if(revFlag)
        G[to].push_back(Edge(from, revCap, (ll)G[from].size() - 1));
}

ll dp[50];

ll f(ll x) {
    if(x < 2)
        return 1;
    if(dp[x])
        return dp[x];
    return dp[x] = f(x - 1) + f(x - 2);
}

void solve() {
    ll n;
    cin >> n;
    cout << f(n) << en;
}

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

    solve();

    /*
    ll t;
    cin >> t;
    REP(i, t) { solve();}
    */

    return 0;
}

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

int main() {
	int n;
	int i;
	vector<long long> fib;
	scanf("%d",&n);
	fib.resize(n);
	fib[0]=fib[1]=1;
	for(i=2; i<n; ++i) {
		fib[i]=fib[i-1]+fib[i-2];
	}
	printf("%lld\n",fib[n-1]);
	return 0;
}

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

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

int main() {
	int n,F[MAX];
	cin >> n;
	Fibonachi(F,n);
	cout << F[n] << endl;
	return 0;
}

C++: #include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<functional>
#include<queue>
#include<math.h>
#define INF 999999

using namespace std;

int memo[50];

int fib(int n)
{
	memo[0] = 1;
	memo[1] = 1;

	if (n == 0)return 1;
	else if (n == 1)return 1;
	else {
		for (int i = 2; i <= n; i++) {
			memo[i] = memo[i - 1] + memo[i - 2];
		}
		return memo[n];
	}
}

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

	int ans = fib(n);
	cout << ans << endl;

	return 0;
}