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>
#include<algorithm>
#define Max 44
#define null (-1)
using namespace std;
int f[Max];
int fib(int a){
	if(a==0 || a==1)
	return f[a]=1;
	if(f[a]!=null)
	return f[a]; 
	return f[a]=fib(a-1)+fib(a-2);
	
}
main(){
	int n;
	cin>>n;
	for(int i=0;i<=n;i++)
	f[i]=null;
	cout<<fib(n)<<endl;
	return 0;
}

C++: object Main extends App {
  val fibs: Array[Option[Int]] = Array.fill(45)(None)
  val n: Int = io.StdIn.readInt()
  fibs(0) = Some(1); fibs(1) = Some(1)
  println(fib(n))

  def fib(n: Int): Int = fibs(n) match {
    case None =>
      val fibN: Int = fib(n-1) + fib(n-2)
      fibs(n) = Some(fibN)
      fibN
    case Some(x) => x
  }
}

C++: #include <bits/stdc++.h>
#define LOOP(n) for (int _i = 0; _i < (n); _i++)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define RREP(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, r, n) for (int i = (r); i < (n); ++i)
#define ALL(obj) begin(obj), end(obj)
using namespace std;
using ll = long long;
using ull = unsigned long long;
using P = pair<int, int>;
using Graph = vector<vector<int>>;

const int INF = 2100100100;
const int MOD = 1e9 + 7;

// 多次元 vector 生成
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
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 N, M, K, Q, W, H, R, C;
int dp[100];

ll f(int n) {
    if (n <= 1) return 1;
    if (dp[n] != INF) return dp[n];
    ll ret = f(n - 1) + f(n - 2);
    dp[n] = ret;
    return ret;
}

int main() {
    // cin.tie(0);
    // ios::sync_with_stdio(false);

    cin >> N;
    REP(i, 100) dp[i] = INF;
    cout << f(N) << endl;
    return 0;
}

C++: // Ref : https://book.mynavi.jp/ec/products/detail/id=35408

#include <iostream>
using namespace std;

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

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

int main() {
  int fib[45];
  fib[0]=1;
  fib[1]=1;
  for(int i=2;i<45;i++){
    fib[i]=fib[i-1]+fib[i-2];
  }

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

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

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

int main(void)
{
    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;

#define MAX 44

int F[MAX];

int main() {
    int n;
    cin >> n;
    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 <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
#define PRINT(x) cout<<(x)<<endl
#define INF 1000000000000 // 10^12
#define MOD 1000000007 // 10^9+7
#define PB push_back
#define MP make_pair

const int MAX_N = 44;

int n;

int dp[MAX_N];

int main() {
    cin >> n;
    dp[0] = 1, dp[1] = 1;
    REP2(i, 2, n+1) dp[i] = dp[i-1] + dp[i-2];
    PRINT(dp[n]);
    return 0;
}

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

const int Max = 50;
int F[Max];

int Fib(int n)
{
    F[0] = 1;
    F[1] = 1;
    if(n==0 || n==1) return F[n];
    if(!F[n-1])
        F[n-1] = Fib(n-1);
    if(!F[n-2])
        F[n-2] = Fib(n-2);
    return F[n-1]+F[n-2];
}
int main()
{
    int n;
    cin >> n;
    memset(F, 0, sizeof(F));
    cout << Fib(n) << endl;
}

C++: #include <iostream>

using namespace std;
int fib(int n){
    int dp[50];
    dp[0] = 1;
    dp[1] = 1;
    for(int i = 2; i < 45; ++i){
        dp[i] = dp[i-1] + dp[i-2];
    }
    return dp[n];
}

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

C++: #include <iostream>
#include <fstream>
#include <stdio.h>
#include <algorithm>

#define MAX 1000000

using namespace std;

int fib[MAX];

int solve(int a){
    if(fib[a])return fib[a];
    if(!fib[a-2])fib[a-2] = solve(a-2);
    if(!fib[a-1])fib[a-1] = solve(a-1);
    return fib[a-1]+fib[a-2];
}

int main(int argc, const char * argv[]) {
    // input from txt
    
    /////////
    //write//
    /////////
    
    fill(fib, fib+MAX, 0);
    fib[0] = 1;
    fib[1] = 1;
    int num; cin >> num;
    cout << solve(num) << endl;
    
    return 0;
}

C++: #include <cstdio>

using namespace std;

int main()
{
    int n;
    scanf("%d", &n);
    int sum;
    if(n==0){
        sum=1;
    } else if(n==1){
        sum=1;
    } else{
        int older=1, oldest=1;
        sum=0;
        for(int i=2; i<=n; i++){
            sum=older+oldest;
            oldest=older;
            older=sum;
        }
    }
    printf("%d\n", sum);
    return 0;
}

C++: #include <stdlib.h>
#include <stdio.h>

int fib(int n){
int i;
int a[25];
a[0]=a[1]=1;
for(i=2;i<n;i++){
a[i]=a[i-1]+a[i-2];
   }
return a[i];
}

int main(){

int x;
scanf("%d",&n);
x=fib(n);
printf("%d",x);

return 0;
}

C++: #include <iostream>
using namespace std;
int fib(int n) {
    if(n==1) 
        return 1;
    else if(n==2)
        return 2;
    else
        return fib(n-1) + fib(n-2);
}
int main(void){
    int n;
    cin >> n ;
    cout << fib(n) << endl;
    return 0;
}

C++: #include <iostream>

using namespace std;

int fib(int n);

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

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

    //??\???
    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;
}

C++: #include<iostream>
using namespace std;
int nrec(int n){
    int a[44];
    a[0]=a[1]=1;
    for(int i=2;i<=n;i++){
        a[i]=a[i-1]+a[i-2];  
    }
    return a[n];
}

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