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 main(){
  long long int a = 1, b = 1;
  int n; cin >> n;

  for(int i=0;i<n;++i){
    long long int c = a + b;
    a = b;
    b = c;
  }
  cout << a << endl;

  return 0;
}

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

int fib(int n, int a, int b);

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


int fib(int n, int a, int b){
	int f;
	if (n != 0){
		f = fib(n - 1, a + b, a);
  }
	else f = a + b;
	return (f);
}

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

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

C++: #include <iostream>

using namespace std;

int ans[45] = 0;

int fib(int n) {
	if (n <= 1) return 1;
	int a = ans[n];
	if (a) return a;
	a = fib(n-1) + fib(n-2);
	ans[n] = a;
	return a;
}

int main()
{
	int i = 0;
	cin >> i;
	cout << fib(i) << endl;
}

C++: #define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

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


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


int main(int argc, const char * argv[]) {
    
    //Input
    int n;
    scanf("%d", &n);
    
    printf("%d\n", fib(n));
           
    return 0;
}

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

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

  int n; cin >> n;
  vector<int> f(n+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 <cstdio>

using namespace std;

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

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

C++: #include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
    int n;
    cin >> n;
    int a[50];
    a[0] = 1;
    a[1] = 1;
    for(int i = 2;i < 50;i++)
        a[i] = a[i-1]+a[i-2];
    cout << a[n] << endl;
    return 0;
}

C++: #include<iostream>
#include<vector>
using namespace std;
int main(){

	int n;
	cin>>n;
	std::vector<int>a(n);
	a[0]=a[1]=1;
	for(int i=2;i<=n;i++)
		a[i]=a[i-1]+a[i-2];

	cout<<a[n]<<endl;
	
	return 0;
}

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


int n;

int memo[50];

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

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

	for(int i=0;i<50;i++)memo[i] = -1;
	printf("%d\n",fibo(n));
	return 0;
}

C++: #include<map>
#include<set>
#include<list>
#include<cmath>
#include<queue>
#include<stack>
#include<cstdio>
#include<string>
#include<vector>
#include<complex>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<numeric>
#include<sstream>
#include<iostream>
#include<algorithm>
#include<functional>
#include<cctype>

#define mp make_pair
#define pb push_back
#define REP(i,a,n) for(int i = a;i < (n);i++)
#define rep(i,n) for(int i = 0;i < (n);i++)
#define all(s) s.begin(), s.end()
#define rall(s) s.rbegin(), s.rend()

using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<vector<int> > VII;
typedef pair<int,int> PII;

const int DX[]={1,0,-1,0},DY[]={0,-1,0,1};

int dp[45] = {1,1};

int main(){
	cin.tie(0);
   	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	
	for(int i = 2;i < n + 1;i++){
		dp[i] = dp[i - 1] + dp[i - 2];
	}
	cout << dp[n] << endl;

	return 0;
}

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

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

C++: #include<stdio.h>

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

int main()
{
  int n;

  scanf("%d",&n);

  n = fib(n);

  printf("%d\n",n);

  return 0;
}

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

unordered_map<int, int> h;

int fib(int n);

int fib(int n) {
    if (h.count(n) != 0) {
        return h[n];
    }

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

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

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

int fib(int n, map<int, int>& fib_mp)
{
    auto itr = fib_mp.find(n);
    if (fib_mp.end() != itr) return itr->second;
    return fib_mp[n] = fib(n - 1, fib_mp) + fib(n - 2, fib_mp);
}

int main()
{
    int n;
    cin >> n;
    map<int, int> fib_mp;
    fib_mp[0] = fib_mp[1] = 1;
    cout << fib(n, fib_mp) << endl;
    return 0;
}