Go: package main

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

//util
var sc = bufio.NewScanner(os.Stdin)

func nextStr() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func printList(list []int) {
	buf := bufio.NewWriter(os.Stdout)
	for _, v := range list {
		buf.Write([]byte(fmt.Sprintf(" %d", v)))
	}
	buf.Write([]byte("\n"))
	buf.Flush()
}

//solve
//単純な場合
func fibonacci_(n int) int {
	if n == 0 || n == 1 {
		return 1
	}
	return fibonacci_(n-2) + fibonacci_(n-1)
}

//メモ再帰の利用
func fibonacci(n int) int {
	if n == 0 || n == 1 {
		F[n] = 1
	}
	//F[n]が計算済みの場合
	if F[n] > 0 {
		return F[n]
	}
	F[n] = fibonacci(n-2) + fibonacci(n-1)
	return F[n]
}

const MAX = 50

var F [MAX]int

func main() {
	sc.Split(bufio.ScanWords)
	n := nextInt()
	fmt.Println(fibonacci(n))

}

C++: //INCLUDE
//------------------------------------------
#include <bits/stdc++.h>
//DEFINE
//------------------------------------------
#define ll long long
#define ld long double
#define ALLv(a)  (a).begin(),(a).end()
#define ALL(a,n)  (a),(a)+n
#define vi vector<long long>
#define vd vector<long double>
#define vs vector<string>
#define dcml(n) fixed<<setprecision(n)
//CONST
//------------------------------------------
const ll INF=1010000000000000017LL;
const ll MOD=1000000007LL;
const ld EPS=1e-12;
const ld PI=3.14159265358979323846;
//REPEAT
//------------------------------------------
#define   FOR(i,m,n) for(ll (i)=(m);   (i)<(n);  (i)++)
#define  FORS(i,m,n) for(ll (i)=(m);   (i)<=(n); (i)++)
#define  RFOR(i,m,n) for(ll (i)=(n)-1; (i)>=(n); (i)--)
#define RFORS(i,m,n) for(ll (i)=(n);   (i)>(n);  (i)--)
#define   REP(i,n)   for(ll (i)=0;     (i)<(n);  (i)++)
#define  REPS(i,x)   for(ll (i)=1;     (i)<=(x); (i)++)
#define  RREP(i,x)   for(ll (i)=(x)-1; (i)>=0;   (i)--)
#define RREPS(i,x)   for(ll (i)=(x);   (i)> 0;   (i)--)
#define  WREP(i,in,j,jn) REP(i,in)REP(j,jn)
#define WREPS(i,in,j,jn) REPS(i,in)REPS(j,jn)
//-----------------------------------------
//namespace
using namespace std;
//ライブラリはここに
//↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

//-----------------------------------------
int main(void){
    ll N;cin>>N;
    ll dp[N+1];dp[0]=dp[1]=1;
    FORS(i,2,N){
        dp[i]=dp[i-1]+dp[i-2];
    }
    cout<<dp[N]<<"\n";
}

C++: #include <iostream>
#include <vector>
#include <array>

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

  int fib[100];
  fib[0] = 1;
  fib[1] = 1;
  for (int i=2; i<=n; ++i)
    fib[i] = fib[i-1] + fib[i-2];
  std::cout << fib[n] << std::endl;
}

C++: #include<iostream>

using namespace std;


int main(){
  int n,i,note[46];
 cin >> n;

 note[0] = note[1] = 1;

for(i=2;i<=n;i++) note[i] = note[i-1] + note[i-2];

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

C++: // fibonacci number.
#include<stdio.h>

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

C++: #include <iostream>

int Fib[45];

int main(){
  int n;
  std::cin >> n;
  Fib[0]=Fib[1]=1;

  for(int i=2; i<=n; i++){
    Fib[i] = Fib[i-1]+Fib[i-2];
  }
  std::cout << Fib[n] << std::endl;

  return 0;
}

C++: #include <functional>
#include <iostream>
#include <vector>

using namespace std;

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

    vector<int> memo(n + 1, -1);
    function<int(int)> f = [&memo, &f](int nn) -> int {
        if (memo[nn] != -1) {
            return memo[nn];
        }
        else if (nn == 0) {
            memo[nn] = 1;
        }
        else if (nn == 1) {
            memo[nn] = 1;
        }
        else {
            memo[nn] = f(nn - 1) + f(nn - 2);
        }
        return memo[nn];
    };

    cout << f(n) << endl;
}

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

map<int, ll> memo;

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

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

    int n;
    cin >> n;

    memo[1] = 1;
    memo[0] = 1;
    cout << fib(n) << endl;

    return 0;
}

C++: #include <iostream>

using namespace std;

long long F[50];

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

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

C++: #include<iostream>
using namespace std;
int main(){
    int n,fib[45];
    cin>>n;
    fib[0]=fib[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<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;

int main(int argc,char* argv[]){
  int a=1,b=1,x,n;
  cin>>n;
  if(n==1)
    cout<<1<<endl;
  else{
    for(int i=2;i<=n;i++){
      x=a+b;
      a=b;
      b=x;
    }
    cout<<x<<endl;
  }
  return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int n,dp[45]={1,1};
  cin >> n;
  for(int i = 2 ; i <= n ; i++ ) dp[i] = dp[i-1] + dp[i-2];
  cout << dp[n] << endl;
}

C++: #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mod 1000000007
#define MAX 50

ll fib(int n);

ll dp[MAX];

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

ll fib(int n){
    if(dp[n] != -1) return dp[n];

    dp[n] = fib(n-1) + fib(n-2);
    return dp[n];

}

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

int result[44];

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

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

C++: #include<stdio.h>

int fib(int);

int main()
{
  int a,n;

  scanf("%d",&n);

  a = fib(n);
  printf("%d\n",a);

  return 0;
}

int fib(int n){

  int a;
  
  if(n==0 || n==1){
    return 1;
  }

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

  return a;
}