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 A[128];
int fib(int n){
  A[0] =1;
  A[1] =2
  for(int i=2;i<44;++i){
    A[i] =A[i-1];
    if(i>1)A[i]+=A[i-2];
  }
  return A[n-1];

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

C++: #include <bits/stdc++.h>
#include<math.h>
#include<algorithm> 
#define rep(i,n) for (int i = 0; i < (n) ; ++i)
using namespace std;
using ll = long long ;
using P = pair<int, int> ;
#define PI 3.14159265358979323846264338327950
#define INF 1e18

int dp [50] ;
int fib(int x){
    if(x == 1 || x == 0){
        return 1 ;
    }
    if(dp[x]>0){
        return dp[x] ;
    }
    dp[x] = fib(x-1) + fib(x-2) ;
    return fib(x-1) + fib(x-2) ;
}
int main() {
    int n ;
    cin >> n ;
    int ans = fib(n) ;
    cout << ans << endl ; 
}

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

typedef unsigned long long ull;
unsigned long long m[44]={0};


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

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

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

const int MAX = 44;
int MEM[MAX];

int fibonacci(int i) {
  if (MEM[i] != -1) return MEM[i];
  if (i == 0 || i == 1) return 1;
  MEM[i - 2] = fibonacci(i - 2);
  MEM[i - 1] = fibonacci(i - 1);
  return MEM[i - 2] + MEM[i - 1];
}

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

  for (int i = 0; i <= MAX; i++) MEM[i] = -1;

  int i;
  cin >> i;

  cout << fibonacci(i) << endl;

  return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
    int n, dp[50];
    cin >> n;

    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 <iostream>

using namespace std;

unsigned long long *cache;

unsigned long long fun(int n) {
	if (cache[n] == -1) {
		cache[n] = fun(n-1) + fun(n-2);
	}
	return cache[n];
}

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

}

C++: #include <iostream>
#include <sstream>
#include <cstdio>
#include <stdlib.h>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int f[45];
int fib(int n){
  if(n==1||n==0)return 1;
  if(f[n]!=0)return f[n];
  else return f[n]=fib(n-1)+fib(n-2);
}
int main(){
  int  n;
  cin>>n;
  cout<<fib(n)<<endl;



  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define numrep(i,n) for(int i=1;i<=n;i++)
#define bitrep(n) for(int bit=0;bit<(1<<n);bit++)
#define ll int64_t
#define all(v) v.begin(), v.end()

int main() {

int n; cin>>n;

vector<ll> dp(45);
dp[0]=1;
dp[1]=1;

for(int i=2;i<45;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,F[50];
	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 <cstring>
using namespace std;
typedef unsigned long long ull;

ull dp[100];

ull fib(int n) 
{
    if (n == 1 || n == 0) return 1;
    if (~dp[n]) return dp[n];
    return dp[n] = fib(n-1) + fib(n-2);
}

int main(void)
{
  int N;
  cin >> N;
  memset(dp, -1, sizeof(dp));
  cout << fib(N) << endl;
}

C++: #include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
/* 動的計画法
int main(){
    int n;
    int dp[100];
    dp[0]=1;
    dp[1]=1;
    cin >> n;
    for(int i=2;i<=n;i++){
        dp[i]=dp[i-1]+dp[i-2];
        //printf("dp[%d]=%d\n",i,dp[i]);
    }
    

    cout<<dp[n]<<endl;
}
*/
//メモ化再帰
int dp[100];
int n;
int fib(int n){
    if(n==0||n==1)return 1;
    if(dp[n]!=-1)return dp[n];
    return dp[n]=fib(n-1)+fib(n-2);
}

int main(){
    for (int i = 0; i < sizeof(dp)/sizeof(dp[0]); i++)
    {
        dp[i] = -1;
    }
    dp[0]=dp[1]=1;
    cin >> n;
    cout<<fib(n)<<endl;
}

C++: #include <algorithm>
#include<iostream>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<string>
#include <sstream>

#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<limits.h>

using namespace std;


int main(){
  long ii,jj,kk;
  vector<int> ret;
  long long fib[100];

  int n;

  cin >> n;

  fib[0] = 1;
  fib[1] = 1;

  for(ii=2;ii<=n;ii++){
    fib[ii] = fib[ii-1] + fib[ii-2];
  }

  cout << fib[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];
    }
    cout << array[n];
}
int main(void) {

    cin >> num;
    int array[num] = {};
    fib(num, array);


}

C++: #include <iostream>
using namespace std;
int F[100];
int main() 
{
int n;
F[0] = 1;
F[1] = 1;
for (int i=2; i<45; ++i) 
{ // ???????????????
F[i] = F[i-2]+F[i-1];
}
cin>>n;
cout<<F[n];
}