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>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <string>
#include <cctype>
#include <stack>
#include <queue>
#include <vector>
#include <cstdlib>
#include <list>
#define _USE_MATH_DEFINES
#include <math.h>

using namespace std;

int main() {

	int n;
	int F[44];
	cin >> n;

	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>
#include<algorithm>
using namespace std;

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

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


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

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

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

int F[100]; int N;

int main(){
  cin >> N;
  F[0] = 1;
  F[1] = 1;
  for(int i = 2; i < 45; ++i){
    F[i] = F[i-1] + F[i-2];
  }
  
  cout << F[N] << endl;
}

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

long F[45] = {};

void calcfib(){
	for (long i = 0; i < 45; i++){
		if (i == 0 || i == 1) F[i] = 1;
		else F[i] = F[i - 1] + F[i - 2];
	}
}

int main(){
	long n;
	cin >> n;
	calcfib();
	cout << F[n] << endl;
	return 0;
}

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

int main()
{
 int n; cin>>n;
 vector<ll> fib(n + 1);
 fib.at(0) = 1;
 fib.at(1) = 1;
 for (int i = 2; i <= n; i++)
 {
   fib.at(i) = fib.at(i - 1) + fib.at(i - 2);
 }
 cout << fib.at(n) << endl;

}

C++: #include<algorithm>
#include<climits>
#include<cmath>
#include<iomanip>
#include<iostream>
#include<list>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<utility>
#include<vector>

#define lint long long
#define REP(i, x, n) for(int i = x ; i < n ; i++)
#define rep(i, n) REP(i, 0, n)
#define repr(i, n) for(int i = n - 1 ; i >= 0 ; i--)
#define SORT(c) sort((c).begin(), (c).end())
#define SORT_INV(c) sort((c).begin(), (c).end(), greater<int>())
#define IINF INT_MAX
#define LLINF LLONG_MAX

using namespace std;

lint fib[50] = {0};

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

C++: #define scanf_s scanf
#include <iostream>
using namespace std;
int F[46] = { 0 };
int fib(int n) 
{
	if (n >= 0) {
		if (n <= 1) { return F[n] = 1; }
		if (F[n] != 0) {
			return F[n];
		}
		return F[n] = fib(n - 1) + fib(n - 2);
	}
}
int main(void)
{
	int n;
	scanf_s("%d", &n);
	printf("%d\n", fib(n));
}

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

static const int maxn=44;

int DP[45];

int Fibonacci(int n) {
  if (n==0 or n==1) {
    return DP[n]=1;
  }
  if (DP[n]!=(-1)) {
    return DP[n];
  }
  return DP[n]=Fibonacci(n-1)+Fibonacci(n-2);
}
int main() {
  std::ios::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  memset(DP,(-1),sizeof(DP));
  Fibonacci(maxn);
  int n;
  cin>>n;
  cout<<DP[n]<<endl;
  return 0;
}

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


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

    int dp[50];
    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>
#define REP(i, n) for (int i = 0; i < n; ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; --i)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define FORR(i, a, b) for (int i = b - 1; i >= a; --i)
#define SORT(v) sort(v.begin(), v.end())
#define SORTR(v) sort(v.rbegin(), v.rend())
#define REV(v) reverse(v.begin(), v.end())
#define ITER(itr, v) for (auto itr = v.begin(); itr != v.end(); ++itr)
#define LB(v, x) (lower_bound(v.begin(), v.end(), x) - v.begin())
#define UB(v, x) (upper_bound(v.begin(), v.end(), x) - v.begin())
#define SZ(v) (int)v.size()
using namespace std;
using ll = long long;
using P = pair<int, int>;

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

	int n;
	cin >> n;
	vector<ll> fib(n + 1);
	fib[0] = 1;
	fib[1] = 1;
	FOR(i, 2, n + 1) {
		fib[i] = fib[i - 1] + fib[i - 2];
	}
	cout << fib[n] << endl;

	return 0;
}