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++: // 

// g++ -std=c++11 abc145_c.cc && ./a.out 
#include <algorithm>
#include <bitset>
#include <cmath>
#include <functional>
#include <iomanip>
#include <ios>
#include <iostream>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;


int memo[50];
int n;

int fibo(int i) {
    if (memo[i] != 0) { return memo[i]; }

    int result = fibo(i - 1) + fibo(i - 2);
    memo[i] = result;
    return result;
}

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

    rep(i, n) memo[i] = 0;
    memo[0] = 1;
    memo[1] = 1;

    cout << fibo(n) << endl;

    return 0;
}

C++: #include<iostream>

using namespace std;

int fib(int n);

int main() {
  int n;

  //入力
  cin >> n;

  //出力
  cout << fib(n) << endl;

  return 0;
}

int fib(int n){
  int dp[1000];
  dp[0] = 1;
  dp[1] = 1;

  for(int i = 2; i <= n; i++){
    dp[i] = dp[i-1] + dp[i-2];
  }
  return dp[n];
}

C++: #include<functional>
#include<algorithm>
#include<iostream>
#include<utility>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,x,n) for(int i=x;i<n;i++)
#define all(v) (v).begin(),(v).end()
#define pf push_front
#define pb push_back
#define int long long
using namespace std;
const int INF=1000000007;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int f[50]={};

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

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

  return 0;
}

C++: #include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <climits>
#include <cstring>
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))

using namespace std;

const int N_MAX = 1000000;
int dp[N_MAX];


int fib(int n, int* dp){
  if(n==0) dp[n] = 1;
  if(n==1) dp[n] = 1;

  if(dp[n] >= 0) return dp[n];
  else dp[n] = fib(n-2, dp) + fib(n-1, dp);
  return dp[n];
}

int main(){
  int n;
  cin >> n;
  memset(dp, -1, N_MAX * sizeof(dp[0]));
  cout << fib(n, dp) << endl;
  return 0;
}

C++: #include<iostream>
using namespace std;
#define n 44
int F[n],Fl[n];
int fibonacci(int na)
{
    if( na == 1 || na == 2)
        return F[na] = 1;
    if(F[na])
        return F[na];
    return F[na] = fibonacci(na - 1) +fibonacci(na - 2 ) ;
}

void makeFibonacci()
{
    Fl[1] = Fl[0] = 1;
    for(int i=2;i<=n;i++)
    {
        Fl[i] = Fl[i-1] + Fl[i-2];
    }
}

int main()
{
    int na;
    cin>>na;
    //cout<<fibonacci(na)%10007<<endl;
    makeFibonacci();
    cout<<Fl[na]<<endl;
    return 0;
}

C++: #include<stdio.h>

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

C++: #include <cstdio>

using namespace std;

int sum = 0;

int fib( int n ){

    if( n >= 0) {

        if( n == 0 || n == 1 ){

            return 1;

        } else {

            sum = fib( n - 1 ) + fib( n - 2 );        

        }

    } else return 0;

    return sum;

}

int main(){

    int n;

    scanf("%d", &n);

    int ans = fib(n);

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

}

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

int Fib(int n){
	double phi = (1+sqrt(5))/2;
	return floor(pow(phi,n)/sqrt(5) + 0.5 );
}

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

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int a[44];
  a[0]=1;
  a[1]=1;
  for(int i=2;i<=44;i++)a[i]=a[i-1]+a[i-2];
  int n;
  cin>>n;
  cout<<a[n]; 
  return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define  all(x) (x).begin(),(x).end()
typedef long long ll;

int f[45];

void fib(int n){
    f[0] = f[1] = 1;
    for(int i = 2; i <= n; i++){
        f[i] = f[i-1] + f[i-2];
    }
}

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

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

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

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