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++: 
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep2(i,a,b) for(ll i=a;i<=b;++i)
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep3(i,a,b) for(ll i=a;i>=b;i--)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define veci vector<int>
#define vecll vector<ll>
#define vecpii vector<pii>
#define vec2(a,b) vector<vec>(a,vec(b))
#define vec2ll(a,b) vector<vec>(a,vecll(b))
#define vec3(a,b,c) vector<vector<vec>>(a,vec2(b,c))
#define vec3ll(a,b,c) vector<vector<vecll>>(a,vec2ll(b,c))
#define fi first
#define se second
#define all(c) begin(c),end(c)
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))


using namespace std;
int in() {int x;cin>>x;return x;}
ll lin() {ll x;cin>>x;return x;}
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T> inline void print(pair<T,T> p){cout<<"("<<p.first<<","<<p.second<<") ";}
//template<class T> inline void print(vector<pair<T,T>> v){for(auto e:v)print(e); cout<<endl;}
//template<class T> inline void print(T v){for(auto e:v)cout<<e<<" ";cout<<endl;}
template<typename T>
istream& operator >> (istream& is, vector<T>& vec){
    for(T& x:vec) is >> x;
    return is;
}
const ll INF=1e9+7;

ll dp[50];

ll fib(ll n){
    if(n<=1) return 1;
    if(dp[n]!=-1) return dp[n];
    return dp[n]=fib(n-1)+fib(n-2);
}

int main()
{
    ll n;
    cin >> n;
    rep(i,50){
        dp[i]=-1;
    }
    cout << fib(n) << endl;
    
    return 0;
}

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

vector<int> F(50, 0);

int fib(int x) {
  if(F[x] != 0) return F[x];
  
  if(x==0 or x==1) F[x] = 1;
  else F[x] = fib(x-1)+fib(x-2);
  
  return F[x];
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(18);
  
  int n;
  cin >> n;
  cout << fib(n) << "\n";
}

C++: #include<iostream>
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];
}

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

int main(){
    int n;
    int ans;
    int f[44];
    f[0] = 1;
    f[1] = 1;
    cin >> n;
    for(int i=2; i<=n; i++) f[i] = f[i-1] + f[i-2];
    ans = f[n];
    cout << ans << '\n';
}

C++: #include <iostream>
#define rep(i,a) for(int i=0;i<(a);++i)

int fib[45];
int n;

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

  fib[0] = fib[1] = 1;
  rep( i, n-1 )
    fib[i+2] = fib[i] + fib[i+1]; 

  printf( "%d\n", fib[n] );

  return 0;
}

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

int memo[100];
int fibonacci( int a )
{
    if( a == 0 || a == 1 )
        return memo[0] = memo[1] = 1;
    else
    {
        if( memo[a] != 0 )
            return memo[a];
        else
            return memo[a] = fibonacci( a - 1 ) + fibonacci( a - 2 );
    }
}

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

    cout << fibonacci(n) << endl;

    return 0;
}

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

int fib(int n){
	int ans[45] = {1,1},i;
	for(i=2;i<=n;i++){
		ans[i] = ans[i-1]+ans[i-2];
	}
	return ans[n];
}

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

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

long long int dp[50];

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


int main(void){
	int n, i;
	long long int m;
	for (i = 0; i <= 50; i++) {
		dp[i] = -1;
	}

	scanf("%d", &n);
	m = fib(n);
	printf("%lld\n", m);

	return 0;
}

C++: 
#include<iostream>

using namespace std;

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

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

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

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

C++: #include <iostream>

using namespace std;

int main() {
    int n;
    cin >> n;
    int F[n + 1];

    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"

using namespace std;

int fib( int n ) {

	if (n == 0 || n == 1) return 1;

	else return fib(n - 1) + fib(n - 2);
}

int main() {


	int n;

	cin >> n;

	cout << fib(n) << endl;

	return 0;
}

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

class Fibonacci{
private:
	int f[45];
	int len;
public:
	Fibonacci(){ f[0] = f[1] = 1; len = 2; }
	int calc(int n);
};

int Fibonacci::calc(int n)
{
	if (n < len) return f[n];
	f[n] = calc(n - 1) + calc(n - 2);
	len++;
	return f[n];
}

int main(void)
{
	Fibonacci fib;
	int n;
	cin >> n;
	cout << fib.calc(n) << endl;
}