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 fib(int F[], int n) {
  if (n == 0) return 1;
  if (n == 1) return 1;
  if (F[n]) return F[n];
  F[n-1] = fib(F, n-1);
  F[n-2] = fib(F, n-2);
  return F[n-1] + F[n-2];
}

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

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

vector<int> F;

int fibonacci(int N)
{
	F.push_back(1);
	F.push_back(1);
	for (int i = 2; i <= N; i++)
	{
		F.push_back(F[i - 2] + F[i - 1]);
	}
	return F[N];
}

int main(void)
{
	int N, ans;
	cin >> N;

	ans = fibonacci(N);

	cout << ans << endl;

	return 0;
}

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

#define MAX 50

using namespace std;

int m_fibo(int n){
    static int ans[MAX];
    if(n == 0 || n == 1) ans[n] = 1;
    if(ans[n] > 0) return ans[n];
    return ans[n] = m_fibo(n-1)+m_fibo(n-2);
}

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

C++: #include <cstdio>

int fibonacci(int* fib, int n){
    if(n<=1)return 1;
    if(fib[n]>0)return fib[n];
    fib[n] = fibonacci(fib, n-1) + fibonacci(fib, n-2);
    return fib[n];
}

int main(){
    int i, n, fib[45];
    for(i=0;i<45;i++){
        fib[i]=-1;
    }
    scanf("%d",&n);
    printf("%d\n",fibonacci(fib, n));
    return 0;
}

C++: #include<iostream>
using namespace std;
int memo[50];
int fib(int n){
  if(memo[n] >= 0)return memo[n];
  if(n <= 1)return 1;
  return memo[n] = fib(n-1) + fib(n-2);
}

int main(){
  int n;
  cin >> n;
  fill(memo,memo+50,-1);
  cout << fib(n) << endl;
}

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

int main(){
	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 <cstdio>
#include <cstdlib>
#include <time.h>
#include <math.h>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <iterator>
#include <sstream>
#include <string>
#include <bitset>
using namespace std;
#define FOR(I,F,N) for(int I = F; I < (int)(N); I++)
#define rep(i, n) FOR(i, 0, n)
#define FIN(V) cout<<V<<endl
#define pb push_back
#define INF (1 << 30)
typedef pair<int, int> P;
typedef long long ll;
typedef priority_queue<int> pq;
int StrToInt(string);
string IntToStr(int);
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};
int fib(int n){
	int dp[1000];
	fill_n(dp, 1000, 0);
	dp[0] = 1;
	dp[1] = 1;
	for(int i = 2; i < n; i++){
		dp[i] = dp[i-1] + dp[i-2];
	}
	return dp[n-1];
}

int main(void){
	int n;
	cin >> n;
	FIN(fib(n+1));
	return 0;
}

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

int main() {
  int x, y;
  int F[50];
  F[0] = F[1] = 1;
  for ( int i = 2; i < 50; i++ ) F[i] = F[i-1] + F[i-2];

  cin >> x;
  cout << F[x] << endl;

  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef pair<ll,ll> Pll;
typedef pair<string,string> Pstring;
typedef pair<double,double> Pdouble;



#define REP(i,n) for(ll i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define Precision13 cout << fixed << setprecision(13)
const double PI=3.14159265358979323846;
const int MAX = 510000;
const int MOD = 1000000007;
const int INF = 1<<29;

using Graph = vector<vector<char>>;

int main() {
  ll n;
  cin >> n;
  ll dp[50];
  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;
}

C++: #include <cstdint>

using namespace std;

#define MEMO_SIZE 44
int64_t memo[MEMO_SIZE];

void fib_init()
{
  for (uint32_t i = 0; i < MEMO_SIZE; i++) {
    memo[i] = -1;
  }
}

uint32_t fib(uint32_t i)
{
  if (i == 0) {
    return memo[0] = 1;
  } else if (i == 1) {
    return memo[1] = 1;
  } else {
    int64_t val1 = memo[i - 1], val2 = memo[i - 2];
    if (val1 == -1) {
      val1 = memo[i - 1] = fib(i - 1);
    }

    if (val2 == -1) {
      val2 = memo[i - 2] = fib(i - 2);
    }

    return val1 + val2;
  }
}

#include <iostream>

int32_t main()
{
  fib_init();
  uint32_t i;
  cin >> i;
  cout << fib(i) << endl;
  return 0;
}

C++: #include<iostream>
using namespace std;
int main(void){
	int n;
	cin>>n;
	int fib[n];
	fib[0]=fib[1]=1;
	for(int i=2;i<=n;i++)fib[i]=fib[i-1]+fib[i-2];
	cout<<fib[n]<<endl;;
	return 0;
}

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

int n;
int F[45];
int fibo(int i) {
    if (F[i]) {
        return F[i];
    }
    return fibo(i - 1) + fibo(i-2);
}

int main() {
    cin >> n;
    F[0] = F[1] = 1;
    cout << fibo(n);

    return 0;
}

C++: #include <cstdio>
#include <iostream>
#include <cmath>
#include <ctype.h>
#include <string>
#include <sstream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>
#include <set>

using namespace std;

int main()
{
    int fib[45] = {};
    fib[0] = fib[1] = 1;

    int n;
    cin >> n;
    if (n < 2) {
        cout << fib[n];
    } else {
        for (int i = 2; i <= n; i++) {
            fib[i] = fib[i - 1] + fib[i - 2];
        }
        cout << fib[n] << endl;
    }

    return 0;
}

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

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