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++: //http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_10_A
#include <iostream>
using namespace std;

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

int fib(int n){
    int a0 = 0, a1 = 1;
    int a2 = 0;
    for(int i=0; i<n; i++){
        a2 = a0+a1;
        a0 = a1;
        a1 = a2;
    }
    return a2;
}


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

}

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

int main(){
 int n;
 cin>>n;
 int F[50];
 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>
#include <vector>

using namespace std;

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

C++: #include<stdio.h>

int fibonacci(int);
int dp[44];

int main(){
  int n,i;

  for(i=0;i<=44;i++){
    dp[i]=-1;
  }

  scanf("%d",&n);

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

  return 0;
}

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

C++: #include <bits/stdc++.h>

using namespace std;

#define FOR(i,s,e) for((i)=(s);(i)<(int)(e);(i)++)
#define REP(i,e) FOR(i,0,e)

#define all(o) (o).begin(), (o).end()
#define psb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))

typedef long long ll;
typedef pair<int, int> PII;

const double EPS = 1e-10;

const int M = 2;
int a[M][M], b[M][M], w[M][M];
int n;

//???????£?
//recursive function(with/without memo)

void multiple_mat_ab_b() {
  int i, j, k;
  memset(w, 0, sizeof(w));
  for (i=0; i<M; i++)
    for (j=0; j<M; j++)
      for (k=0; k<M; k++)
        w[i][j] += a[i][k]*b[k][j];

  for (i=0; i<M; i++)
    for (j=0; j<M; j++)
        b[i][j] = w[i][j];
}

void multiple_mat_aa_a() {
  int i, j, k;
  memset(w, 0, sizeof(w));
  for (i=0; i<M; i++)
    for (j=0; j<M; j++)
      for (k=0; k<M; k++)
        w[i][j] += a[i][k]*a[k][j];

  for (i=0; i<M; i++)
    for (j=0; j<M; j++)
        a[i][j] = w[i][j];
}

void pow_mat_a(int k) {
  a[0][0] = a[0][1] = a[1][0] = 1;
  a[1][1] = 0;

  b[0][0] = b[1][1] = 1;
  b[0][1] = b[1][0] = 0;

/*
  while (k) {
    if (k & 1) multiple_mat_ab_b();
    multiple_mat_aa_a();
    k >>= 1;
  }
*/
  for (int i=0; i<k; i++)
    multiple_mat_ab_b();
}

int main() {
  scanf("%d ", &n);
  pow_mat_a(n);
  printf("%d\n", b[1][0]+b[1][1]);

	return 0;
}

C++: #include <iostream>

using namespace std;

int main(){
	int n;
	long f[45];
	f[0] = f[1] = 1;
	cin >> n;
	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){
    return 0;
  }
  if(n==0||n==1){
    return 1;
  }
  return fib(n-1)+fib(n-2);

}

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

C++: #include<iostream>

using namespace std;
int fib(int n);

int memo[45];
int main(){
  int n;
  cin >> n;
  cout << fib(n) << endl;
  retrun 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<stdio.h>
#include<math.h>

int f[45];

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

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

int main(){
	int n;
	cin>>n;
	int F[50];
	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 fibonacci(int n) {
	if (n == 0|| n== 1)return 1;
	else return fibonacci(n - 1) + fibonacci(n - 2);
}*/
int fibonacci(int n) {
	int F[44];
	F[0] = 1;
	F[1] = 1;
	for (int i = 2; i <= n; i++) {
		F[i] = F[i - 2] + F[i - 1];
	}
	return F[n];
}
int main() {
	int n;
	cin >> n;
	cout<<fibonacci(n)<<endl;
	return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

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

#define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i))
#define REP(i, n) FOR(i,n,0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll) 1e15;

ll F[100];

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N;
    cin >> N;
    F[0] = F[1] = 1;
    FOR(i, N + 1, 2) {
        F[i] = F[i - 1] + F[i - 2];
    }
    cout << F[N] << endl;
    return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

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

C++: #include<iostream>
using namespace std;
int main(void){
int n;
int a=1,b=1,tmp=1;

cin>>n;

for(int i=2; i<n+1; i++){
  tmp = a + b;
  a = b;
  b = tmp;
}

cout<<tmp<<endl;

return 0;
}

C++: #include <iostream>

using namespace std;

int fib(int n);

int main() {
    int n;
    int dp[45];

    //?????????
    /* ??????3-1 */
    dp[0] = 1;
    /* ??????3-2 */
    dp[1] = 1;

    //??\???
    cin >> n;

    //DP
    for (int i = 2; i <= n; i++) {
        /* ??????3-3 */
        dp[i] = dp[i-1] + dp[i-2];
    }

    //??????
    cout << dp[n] << endl;

    return 0;
}