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 n);

int memo[45];

int main() {
  int n;

  //入力
  cin >> n;

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

  return 0;
}

int fib(int n){

  if(n == 0) return 1;
  else if(n == 1) return 1;
  else if(memo[n] != 0) return memo[n];
  else return memo[n] = fib(n-1) + fib(n-2);
}

C++: #include <iostream>

using namespace std;

int A[128];
int fib(int n){
  A[0] =1;
  for(int i=1;i<44;++i){
    A[i] =A[i-1];
    if(i>1)A[i]+=A[i-2];
  }
  return A[n-1];

}

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

C++: #include <iostream>

using namespace std;
int n;
int a[50];

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

C++: #include <iostream>
#include <stdio.h>
#include <fstream>
#include <algorithm>
#include <string>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <limits.h>
#include <math.h>
#define rep(i,n) for (int i = 0; (i) < (n); ++ (i))
using namespace std;

int fib(unsigned int n);

int main(void){
    unsigned int n;
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n;
    cout << fib(n) << endl;
}

int fib(unsigned int n) {
    vector<int> ary(n+1);
    ary[0] = 1;
    ary[1] = 1;
    for(int i = 2; i <= n; ++i) ary[i] = ary[i-1] + ary[i-2];
    return ary[n];
}

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

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

C++: #include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <numeric>
#include <queue>
#include <map> 
#include <set>
#include <string>
#include <functional>
using namespace std;
long long mem[50] = {0};
long long fib(int n){
	if (mem[n] != 0) return mem[n];
	if (n == 0 || n == 1){
		mem[n] = 1;
		return 1;
	}
	else{
		mem[n] = fib(n - 1) + fib(n - 2);
		return fib(n - 1) + fib(n - 2);
	}
}
int main(){
	int n;
	cin >> n;
	cout << fib(n) << "\n";
	return 0;
}

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

C++: // DP(???????¨??????? Dynamic Programing)
// ????????±???????????¢???
// ?????£??????????????°???
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_10_A

#include <iostream>
using namespace std;

#define MAX_N 44

struct memo{
    int num;
    bool flg;
}Memo[MAX_N+1];

int n;
int fib(int);

int main()
{
    cin >> n;
    for(int i=0;i<MAX_N+1;++i)
        Memo[i].flg=false;
    cout << fib(n) << endl;
    return 0;
}

int fib(int m){
    if(m == 0){
        if(!Memo[0].flg){
        Memo[0].num=1;
        Memo[0].flg=true;
        }
        return 1;
    }
    if(m == 1){
        if(!Memo[1].flg){
        Memo[1].num=2;
        Memo[1].flg=true;
        }
        return 1;
    }

    if(Memo[m].flg){
        return Memo[m].num;
    }
    else{
        Memo[m].num=fib(m-1) + fib(m-2);
        Memo[m].flg=true;
        return fib(m-1) + fib(m-2);
    }
}

C++: #include <iostream>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;

int main() {
    int f[50];
    f[0]=f[1]=1;
    int n;
    cin>>n;
    rep(i,n+1) if(i>1) f[i]=f[i-1]+f[i-2];
    cout<<f[n]<<endl;
    return 0;
}

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

int fib(int n);

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

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

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

#define MIN(X,Y) ((X)<(Y)?(X):(Y))
#define MAX(X,Y) ((X)>(Y)?(X):(Y))

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

C++: #include <iostream>
#include <cstring>
#include <cmath>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <set>
#include <map>
#include <iterator>
#include <stack>
#include <string.h>
#include <cstdlib>
#include <queue>
#include <list>
#include <string>

using namespace std;

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

C++: #include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctype.h>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>

using namespace std;

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

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

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

typedef long long hyper

hyper fib(int n)
{
    if(n < 2) return 1;
    if(n == 2) return 2;
    if(n == 3) return 3;
    return 3 * fib(n - 2) + fib(n - 4);
}
 
int main()
{
    int n;
    cin >> n;
    cout << fib(n) << endl;
    return 0;
}