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<bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin >> n;
    int a1 = 1, a2 = 1, temp;
    for(int i = 1; i < n; i++){
        temp = a2;
        a2 += a1;
        a1 = temp;
    }
    printf("%d\n", a2);
    return 0;
}

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

int A[2000000],N = 0,dp[45];

int fibonacci(int n) {

  if(dp[n] != 0) return dp[n];

  if(n == 0 || n == 1) return dp[n] = 1;
  else return dp[n] = fibonacci(n - 1) + fibonacci(n - 2);
}


int main() {

  int N;
  cin >> N;

  int ans = fibonacci(N);
  cout << ans << endl;

}

C++: #include <iostream>

int Fib[45];

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

  Fib[0]=Fib[1]=1;
  for(int i=2; i<=n; i++){
    Fib[i] = Fib[n-1]+Fib[i-2];
  }
  std::cout << Fib[n] << std::endl;

  return 0;
}

C++: #include <algorithm>
#include <complex>
#include <cstdlib>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

using namespace std;
#define SAY_YES cout << "YES" << endl;
#define SAY_Yes cout << "Yes" << endl;
#define SAY_NO cout << "NO" << endl;
#define SAY_No cout << "No" << endl;
#define IFYES(TRUE_OR_FALSE)   \
    if (TRUE_OR_FALSE)         \
    {                          \
        cout << "YES" << endl; \
    }                          \
    else                       \
    {                          \
        cout << "NO" << endl;  \
    }
#define IFYes(TRUE_OR_FALSE)   \
    if (TRUE_OR_FALSE)         \
    {                          \
        cout << "Yes" << endl; \
    }                          \
    else                       \
    {                          \
        cout << "No" << endl;  \
    }
#define IFyes(TRUE_OR_FALSE)   \
    if (TRUE_OR_FALSE)         \
    {                          \
        cout << "yes" << endl; \
    }                          \
    else                       \
    {                          \
        cout << "no" << endl;  \
    }
#define DEBUG_OUTPUT_ARRAY(XXX, ONE)                            \
    for (int i = 0; i < (ONE); i++)                             \
    {                                                           \
        cout << "DEBUG: i = " << i << " -> " << XXX[i] << endl; \
    }
#define DEBUG_OUTPUT_ARRAY2(XXX, ONE, TWO)                             \
    for (int i = 0; i < (ONE); i++)                                    \
    {                                                                  \
        cout << "<<< i = " << i << " >>>" << endl;                     \
        for (int j = 0; j < (TWO); j++)                                \
        {                                                              \
            cout << "DEBUG: j = " << j << " -> " << XXX[i][j] << endl; \
        }                                                              \
    }
#define DEBUG_OUTPUT_ARRAY2_BOX(XXX, ONE, TWO) \
    for (int i = 0; i < (ONE); i++)            \
    {                                          \
        cout << i << "  ";                     \
        for (int j = 0; j < (TWO); j++)        \
        {                                      \
            cout << XXX[i][j] << " ";          \
        }                                      \
        cout << endl;                          \
    }

typedef pair<long long int, long long int> pll;


const long long int mod = 1000000007;
const long long int INF = 99999999999999999;


long long int N,dp[55]={};
int main()
{
    cout << fixed << setprecision(18);
    cin>>N;
    dp[0]=1;
    dp[1]=1;
    for(long long int i = 2; i < 50; i++){
        dp[i]=dp[i-1]+dp[i-2];
    }
    cout<<dp[N]<<endl;
}

C++: #include<stdio.h>

int main(void){
    int i, n, F[45] = {};
    scanf("%d", &n);

    F[0] = 1;
    F[1] = 1;

    for(i=2;i<=n;i++) F[i] = F[i-2] + F[i-1];

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

    return 0;
}

C++: // input: aldsalds1_10_a.in
#include<iostream>
#define MAX_N 45
#define NIL -1
using namespace std;

int dp[MAX_N];

int fib(int n) {
  if(n == 0 || n == 1)
    return 1;

  if(dp[n] != NIL)
    return dp[n];

  int v = fib(n-1) + fib(n-2);
  dp[n] = v;

  return v;
}

int main() {
  for(int i=0; i<MAX_N; i++)
    dp[i] = NIL;

  int x;
  cin >> x;

  cout << fib(x) << endl;
}

C++: #include<iostream>
#include<set>
#include<queue>
#include<algorithm>
#include<vector>

using namespace std;

int main(){

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

    return 0;
}

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

C++: //http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_10_A&lang=ja
//Fibonacci Number
#include <bits/stdc++.h>
#if LOCAL
#include "dump.hpp"
#else
#define dump(...)
#endif
using namespace std;
using ll=long long;
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
template<class T>bool chmax(T &a, const T &b) {if (a<b) { a=b; return 1; } return 0;}
template<class T>bool chmin(T &a, const T &b) {if (b<a) { a=b; return 1; } return 0;}
int main() {
    ll n; cin>>n;
    vector<ll> dp(max(n+1,2LL));
    dp[0]=1;
    dp[1]=1;    
    FOR(i,2,n+1){
        dp[i]=dp[i-1]+dp[i-2];
    }
    cout<<dp[n]<<endl;
    return 0;
}