Go: package main

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

func main() {
	sc1 := bufio.NewScanner(os.Stdin)
	sc1.Split(bufio.ScanWords)
	sc1.Scan()
	num, _ := strconv.Atoi(sc1.Text())
	cache := make([]*int, num+1)
	fmt.Println(fib(num, cache))

}

func fib(n int, cache []*int) int {
	if n <= 1 {
		return 1
	}

 	if cache[n] != nil {
		return *(cache[n])
	}

	result := fib(n -2, cache) + fib(n -1, cache)
	cache[n] = &result
	return result
}

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

long long dp[101];

long long fib(long long n){
  
  dp[0] = 1;
  dp[1] = 1;

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

  return dp[n];
}

int main(){

  long long n;

  cin>>n;

  memset(dp,0,101);

  cout<<fib(n)<<endl;

  return EXIT_SUCCESS;
}

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

#define N 45

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

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
constexpr int di[] = { 0, 1, 0, -1 }, dj[] = { 1, 0, -1, 0 };
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define SORT(v) sort((v).begin(), (v).end())
#define SORTR(v) sort((v).rbegin(), (v).rend())
#define all(v) (v).begin(), (v).end()
#define vmax 10000
constexpr ll inf = 100000000000000;
/*cout<<fixed<<setprecision(20);cin.tie(0);ios::sync_with_stdio(false);*/

static const int N=101;
static const int W=10010;
int dp[N+1];

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

C++: //#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
const double PI=3.14159265358979323846;
const in MOD = 1000000007;
const in INF=1<<30;
using P=pair<int,int>;
vector<int> dx={0,1,-1,0};
vector<int> dy={1,0,0,-1};



int main(){
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cout << fixed << setprecision(10);
    int n;
    cin>>n;
    vector<int> fib(n+1,1);
    REP(i,2,n+1) fib[i]=fib[i-1]+fib[i-2];
    cout<<fib[n]<<endl;
}

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 fib[45];

void fibonacci(int n)
{
    fib[0] = fib[1] = 1;
    for(int i = 2; i <= n; i++)
        fib[i] = fib[i - 1] + fib[i - 2];
}

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

C++: #include <bits/stdc++.h>
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define REP(i, n) for(int i = 0; i < (n); ++i)
#define SORT(v) sort(v.begin(), v.end());
#define pb(a) push_back(a)
using ll = long long;
using namespace std;

ll dp[50];

ll fib(ll k){
    if(dp[k] != -1){
        return dp[k];
    }else if(k == 0){
        dp[k] = 1;
        return dp[k];
    }else if(k == 1){
        dp[k] = 1;
        return dp[k];
    }else{
        dp[k] = fib(k - 1) + fib(k - 2);
        return dp[k];
    }
}


signed main(){
    REP(i, 50){
        dp[i] = -1;
    }
    ll n;
    cin >> n;
    cout << fib(n) << endl;
    return 0;
}