Go: package main

import (
	"bufio"
	"io"
	"os"
	"strconv"
	"fmt"
)

var (
	nstr   func() string
	stdout *bufio.Writer
)

func init() {
	nstr = newReadString(os.Stdin)
	stdout = bufio.NewWriter(os.Stdout)
}

func main() {
	defer stdout.Flush()
	n := nint()
	r := fibonacci(n)
	fmt.Println(r)
}

func fibonacci(n int) int{
	if n == 0 || n == 1{
		return 1
	}else{
		fiList := make([]int, n+1)
		fiList[0] = 1
		fiList[1] = 1
		for i:=2; i<n+1; i++{
			fiList[i] = fiList[i-1] + fiList[i-2]
		}
		return fiList[n]

	}

}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

func nint64() int64 {
	i, err := strconv.ParseInt(nstr(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func nint() int {
	return int(nint64())
}

func getIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = nint()
	}
	return b
}

func getStringSlice(n int) []string {
	b := make([]string, n)
	for i := 0; i < n; i++ {
		b[i] = nstr()
	}
	return b
}

func gcd(x, y int) int {
	if y == 0 {
		return x
	}
	return gcd(y, x%y)
}

func lcm(x, y int) int {
	return x * y / gcd(x, y)
}

func contains(s []int, e int) bool {
	for _, a := range s {
		if a == e {
			return true
		}
	}
	return false
}

func bin(i int, prefix bool) string {
	i64 := int64(i)

	if prefix {
		return "0b" + strconv.FormatInt(i64, 2)
	} else {
		return strconv.FormatInt(i64, 2)
	}
}

func strReverse(s string) string {
	runes := []rune(s)
	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
		runes[i], runes[j] = runes[j], runes[i]
	}

	return string(runes)
}

C++: #include <iostream>

using namespace std;

int main()
{
        int n;
        cin >> n;
        if (n <= 1) {
                cout << 1 << endl;
                return 0;
        }

        int *fib = new int[n + 1];
        fib[0] = fib[1] = 1;
        for (int i = 2; i <= n; i++) {
                fib[i] = fib[i - 1] + fib[i - 2];
        }
        cout << fib[n] << endl;
        delete [] fib;

        return 0;
}

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

#define N_MAX 45

int table[N_MAX];

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

int main()
{
	for(int i=0; i<N_MAX; i++) table[i] = 0;
	
	int n;
	cin >> n;
	cout << fib(n) << endl;

	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define rep(i,N) for(ll i=0;i<N;++i)
typedef long long int ll;
ll INF = 1LL<<60;

// フィボナッチ数列の第n項の出力
ll dp[1010];

int main(){
    ll N;
    cin >> N;
    dp[0] = 1; dp[1] = 1;
    for(int i=2;i<=N;i++){
        dp[i] = dp[i-1]+dp[i-2];
    }
    cout << dp[N] << endl;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <map>
using namespace std;
typedef long long int ll;

ll a[50];

int main(){
    int n; cin >> n;
    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;
}

C++: #include"iostream"
using namespace std;
int n;
int main()
{
	cin >> n; 
	if (n == 1 || n == 0){
		cout << 1 << endl;
	}
	long long a=1, b=1,c;
	for (int i = 1; i < n; i++)
	{
		c = a + b;
		a = b;
		b = c;
	}
	cout << c << endl;
	return 0;
}

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

int main(){
    int n;
    int F[50];
    cin >> n;
    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<algorithm>
#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;

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

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

    cout << fibonacci(n) << endl;

    return 0;
}

C++: // -*- mode:c++; coding:utf-8; c-basic-offset:2; -*-
// ALDS1_10_A: Fibonacci Number

#include <algorithm>
#include <cstdio>

#define NDEBUG
#include <cassert>

class Fibonnacci {
  static const unsigned int N = 44u;
  unsigned int n_;
  unsigned long* f_;

public:
  Fibonnacci(unsigned int n = N) : n_(std::max(1, n))
  {
    f_ = new unsigned long[n_+1];
    f_[0] = f_[1] = 1;
    for (auto i = 2u; i <= n; ++i) {
      f_[i] = f_[i-1] + f_[i-2];
    }
  }

  ~Fibonnacci() { delete[] f_; }
  
  unsigned long operator () (unsigned int n) const
  {
    assert(n <= n_);
    return f_[n];
  }
};

int main()
{
  unsigned int n;
  std::scanf("%u", &n);
  Fibonnacci fib;
  std::printf("%lu\n", fib(n));
}

// eof

C++: //
//  main.cpp
//  ALDS1_10_A:FibonacciNumber
//
//  Created by Kang on 2020/8/12.
//  Copyright © 2020 Kang. All rights reserved.
//

#include <cstdio>
#include <cstring>
using namespace std;


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

int fiboFromBottom(int n) {
    if (n == 0 || n == 1) {
        return 1;
    }
    int fibo[45];
    fibo[0] = 1;
    fibo[1] = 1;
    for (int i = 2; i <= n; i++) {
        fibo[i] = fibo[i-1] + fibo[i - 2];
    }
    return fibo[n];
}

int main(int argc, const char * argv[]) {
    // insert code here...
    int n;
    int fibonacci[45];
    memset(fibonacci, 0, 45 * sizeof(int));
    scanf("%d", &n);
    
    printf("%d\n", fiboFromTop(n, fibonacci));
    // printf("%d\n", fiboFromBottom(n));
    
    return 0;
}

C++: #include<iostream>
using namespace std;
int fib(int n)
{
    int F[50];
    if(n<=1) return 1;
    F[0] = 1;
    F[1] = 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 fib(int n) {
    if (n <= 1) return 1;
    return fib(n-1) + fib(n-2);
}

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

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

#define REP(i, s, n) for (int i = s; i < n; i++)
#define rep(i, n) REP(i, 0, n)

using namespace std;

// dp memory
const int MAX_N = 44;
int fib[MAX_N+1];

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

    // fib dynamic programming
    fib[0] = 1;fib[1] = 1;
    REP(i, 2, n+1){
        fib[i] = fib[i-1] + fib[i-2];
    }

    cout << fib[n] << endl;
}

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

long long F[100];

int fiv(long long N){
  if(N==0){
    return 1;
  }
  if(N==1){
    return 1;
  }
  if(F[N]!=0){
    return F[N];
  }
  return F[N]=fiv(N-1)+fiv(N-2);
}

  
int main(){
  long long N;
  cin>>N;
  for (int i=0;i<100;i++){
    F[i]=0;
  }
  cout<<setprecision(20)<<fiv(N)<<endl;
  return 0;
 }

C++: #include<cstdio>
#define rep(i,a) for(int i=0;i<(a);++i)

const int MAX_N = 44;

int n;
int fib[MAX_N+1];

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

    fib[0] = 1, fib[1] = 1;

    rep( i, n-1 )
        fib[i+2] = fib[i] + fib[i+1];

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

    return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i, n) for(i = 0; i < n; i++)
using namespace std;

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

int main() {
    int n;
    cin >> n;
    vector<int> f(n+1);
    f[0] = 1;
    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 main(int argc, char const *argv[])
{
  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;
}