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 <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cassert>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define rep(i,n) FOR(i,0,n)
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define vint vector<int>
#define vdouble vector<double>
#define vstring vector<string>
using namespace std;

#include<map>
#include<set>
#include<queue>

typedef long long ll;
typedef unsigned long long ull;

const int MAX_N = 1000000;

int dp[100];
int N;

int main() {
	cin >> N;
	rep(i, N+1){
		if(i == 0 || i == 1) dp[i] = 1;
		else dp[i] = dp[i-2] + dp[i+1];
	}
	cout << dp[N] << endl;
}

C++: #include "bits/stdc++.h"
using namespace std;
int main() {
	vector<long long>Fib(45);
	Fib.at(0) = 1;
	Fib.at(1) = 1;
	for (int i = 2; i < 45; i++) {
		Fib.at(i) = Fib.at(i - 2) + Fib.at(i - 1);
	}
	int N;
	cin >> N;
	cout << Fib.at(N) << endl;
}

C++: #include <iostream>
#include <vector>
#include <cstdio>

using namespace std;

vector<long> dp(10000);

int main () {
    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];
    }
    printf("%ld\n", dp[n]);
}

C++: #include <bits/stdc++.h>
#include <cassert>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
struct Edge
{
  int to;
  int weight;
  Edge(int t, int w) : to(t), weight(w) {}
};
//using Graph = vector<vector<Edge>>;
using Graph = vector<vector<int>>;

const long long INF = 1LL << 60;
const int INT_INF = 1000000000;
const double PI = acos(-1.0);

int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
// int dx[8] = {-1, -1, -1, 0, 0, 1, 1, 1}, dy[8] = {-1, 0, 1, 1, -1, 1, 0, -1};

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  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 <iostream>
#include <algorithm>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string>
#include <vector>
#include <cctype>
#include <cstdio>
#include <iomanip>
#include <functional>
#include <stack>
#define PI 3.1415926535
#define INF 114514810
#define FOR(i, r, n) for(int i=(r); i<(n); i++) 
#define REP(i, n) FOR(i, (0), n)

using namespace std;

int n;

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

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

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


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

int main()
{
    int C;

    cin >> C;

    cout << fibonacci(C) << 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;
  retrun 0;
}

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

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

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

  return 0;
}

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

int main(){
  int fibo[MAX];
  int n;
  fibo[0] = fibo[1] = 1;
  for(int i = 2; i < MAX; i++)
    fibo[i] = fibo[i-1] + fibo[i-2];

  cin >> n;
  cout << fibo[n-1] << endl;
}

C++: #include<stdio.h>
#include<algorithm>
#include<string.h>
using namespace std;
#define NIL -2000000001
#define MAX 2000

int A[MAX];
int n = 0;

int fib(int num) {
  if (num == 0 || num == 1) {
    return A[num];
  } else {
    return fib(num-1)+fib(num-2);
  }
}

int main() {
  int num;
  A[0] = 1;
  A[1] = 1;
  scanf("%d", &num);
  printf("%d\n", fib(num));
  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;
  retrun 0;
}

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

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

const int Max = 45;

int FibArray[Max];

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

int main(){
    int index;
    scanf("%d", &index);

    printf("%d\n", fib(index));
    return 0;
}

C++: #include <iostream>

using namespace std;

int fib(int n);

int main() {
int n;
int dfep[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(void){

	int n;

	cin >> n;

	int f[44];
	f[0] = 1; f[1] = 1;

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

	cout << f[n] << endl;

}

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;

	getchar();
	getchar();
	return 0;
}