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 <iostream>
using namespace std;

int fiboArray[44] = {0};
int fibonacci(int anySection) {
	if (anySection == 0 || anySection == 1)
		return (fiboArray[anySection] = 1);

	if (fiboArray[anySection] == 0) { //?¨?????????????????????????
		fiboArray[anySection] = fibonacci(anySection - 1) + fibonacci(anySection - 2);
		return fiboArray[anySection];
	}
	else //?????§????¨?????????????????????????
		return fiboArray[anySection];
}

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

	int answer = fibonacci(anySection);

	cout << answer << endl;
	return 0;
}

C++: #include<cstdio>
#include<vector>
#include<algorithm>
#include<utility>
#include<numeric>
#include<iostream>
#include<array>
#include<string>
#include<sstream>
#include<stack>
#include<queue>
#include<list>
#define _USE_MATH_DEFINES

#include<math.h>
#include<map>

#define SENTINEL 1000000001

#define min(a,b) (a)>(b)?(b):(a)
#define max(a,b) (a)>(b)?(a):(b)

using namespace std;

int main()
{
	int fib[50];
	fib[0] = 1;
	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] << endl;

	return 0;
}

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

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

    // F[0] から F[N] までのメモリを確保
    // 初期値 0 ，N + 1 コの要素
    vector<ll> dp(N+1, 0);

    // 初期条件，フィボナッチ数列の初期値 F[0] と F[1] は 1
    dp[0] = 1;
    dp[1] = 1;

    // 配列 dp の遷移を行う
    for (int i=2; i<=N; i++){
        // 現在の項以前の 2 項を足す処理
        dp[i] += dp[i-1];
        dp[i] += dp[i-2];
        // cout << i << " : " << dp[i] << endl;
    }

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

C++: #include<cstdio>
int F[46];
int fib(int flag){
	if(flag<2){
		return 1;
	}else if(F[flag]){
		return F[flag];
	}else{
		return F[flag]=fib(flag-1)+fib(flag-2);
	}
}
int main(){
	int num;
	scanf("%d", &num);
	printf("%d\n", fib(num));
	return 0;
}

C++: #include <algorithm>
#include <cmath>
#include <ctime>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
#include <cstring>
#include <tuple>
#include <bitset>
#include <unordered_map>
using namespace std;
typedef long long ll;
int main() {
    ios::sync_with_stdio(false);

    vector<int> 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] << endl;

    return 0;
}

C++: #include <iostream>

int F[50];
int main() {
    int n;
    scanf("%d", &n);

    for (int i = 0; i <= n; i++) {
        if (i <= 1) F[i] = 1;
        else {
            F[i] = F[i-1] + F[i-2];
        }
    }
    printf("%d\n", F[n]);
}

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

#define rep(i, a, n)  for(ll i=a; i<n; i++)
#define per(i, a, n)  for(ll i=n-1; i>=a; i--)
#define fill0(n)  setfill('0') << right << setw(n)
#define all(x)  (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define LONGMAX 1e18
#define INTMAX 1000000000

using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod = 1e9+7;
const long double EPS = 0.0000000001;


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

C++: #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
//#include "MyMath.h"
//#include "MyDisjointset.h"
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <functional>
#include <stdio.h>
#include <math.h>
#include <string.h>
using namespace std;
typedef pair<int, int> P; typedef long long int ll;
const int INF = 100000000;
int mod = 10000;
vector <vector<int> > mul(vector<vector<int> > f, vector<vector<int> > s) {
	vector<vector<int> > res(2, vector <int> (2) );
	res[0][0] = (f[0][0] * s[0][0] + f[0][1] * s[1][0]) % mod;
	res[0][1] = (f[0][0] * s[0][1] + f[0][1] * s[1][1]) % mod;
	res[1][0] = (f[1][0] * s[0][0] + f[1][1] * s[1][0]) % mod;
	res[1][1] = (f[1][0] * s[0][1] + f[1][1] * s[1][1]) % mod;
	return res;
}
int main() {
	int n; cin >> n;
	vector<vector<int> > base(2, vector<int> (2) );
	base[0][0] = 1;
	base[0][1] = 1;
	base[1][0] = 1;
	base[1][1] = 0;
	vector<vector<int> > ans(2, vector<int>(2));
	ans[0][0] = 1;
	ans[0][1] = 0;
	ans[1][0] = 0;
	ans[1][1] = 1;
	while (n > 0) {
		if (n & 1) ans = mul(ans, base);
		//cout << ans[0][0] << " " << ans[0][1] << endl;
		//cout << ans[1][0] << " " << ans[1][1] << endl;
		//cout << endl;
		base = mul(base, base);
		n >>= 1;
	}
	cout << ans[1][0] + ans[1][1]  << endl;
	return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
#define ms(s,x) memset(s,x,sizeof(s))
#define ls rt<<1
#define rs rt<<1|1
#define pb push_back
#define inf 0x3f3f3f3f
#define IOS ios::sync_with_stdio(false)
typedef long long ll;
using namespace std;

const double PI = acos(-1.0);
const double eps = 1e-8;
const int MAXN = 1e5+5;
const ll MOD = 1e9+7;
const int N = 1e5;

int main()
{
    ll fib[45] = {1, 1};
    int n;
    cin >> n;
    rep(i, 2, n){
        fib[i] = fib[i-1] + fib[i-2];
    }
    cout << fib[n] << endl;

    return 0;
}