Go: package main

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

// main
func main() {
	//testFunction()
	solve(bufio.NewScanner(os.Stdin))
}

// test
func testFunction() {
	input := `
3
`
	sc := bufio.NewScanner(strings.NewReader(strings.Trim(input, "\n")))
	solve(sc)
}



func fib(n int, dp map[int]int) int {
	if n == 0 || n == 1 {
		return 1
	}
		if v, ok := dp[n]; ok {
		return v
	}
	r := fib(n - 1, dp) + fib(n - 2, dp)
	dp[n] = r
	return r
}

// solve
func solve(sc *bufio.Scanner) {
	sc.Split(bufio.ScanWords)
	sc.Scan()
	n, _ := strconv.Atoi(sc.Text())
	dp := make(map[int]int)
	r := fib(n, dp)
	fmt.Println(r)
}

C++: #define _USE_MATH_DEFINES
#include<iostream>
#include<vector>
#include<algorithm>
#include<cctype>
#include<utility>
#include<string>
#include<cmath>
#include<cstring>
#include<queue>
#include<map>
#include<set>
#include<climits>
#include<bitset>
#include<stack>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define repi(itr, ds) for (auto itr = ds.begin(); itr != ds.end(); itr++)

using namespace std;

typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef tuple<ll, ll, ll> lltpl;

int dy8[8] = { 2,2,-2,-2,1,1,-1,-1 };
int dx8[8] = { 1,-1,1,-1,2,-2,2,-2 };
int dx4[4] = { 1,0,0,-1 };
int dy4[4] = { 0,1,-1,0 };


/******************************************************************************************/


const int IINF = 1e9 + 7;
const ll LINF = LLONG_MAX;
constexpr ll MOD = 1e9 + 7;



template<typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }
template<typename T, typename... Ts>
auto make_v(size_t a, Ts... ts) {
	return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}
template<typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T& t, const V& v) { t = v; }
template<typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T& t, const V& v) {
	for (auto& e : t) fill_v(e, v);
}

// vector
template <typename T>
istream& operator>>(istream & is, vector<T> & vec) { for (T& x : vec) is >> x; return is; }
// pair
template <typename T, typename U>ostream& operator<<(ostream & os, pair<T, U> & pair_var) { os << "(" << pair_var.first << ", " << pair_var.second << ")"; return os; }
// vector
template <typename T>ostream& operator<<(ostream & os, const vector<T> & vec) { os << "{";	for (int i = 0; i < vec.size(); i++) { os << vec[i] << (i + 1 == vec.size() ? "" : ", "); }os << "}"; return os; }
// map
template <typename T, typename U>ostream& operator<<(ostream & os, map<T, U> & map_var) { os << "{";	repi(itr, map_var) { os << *itr; itr++; if (itr != map_var.end()) os << ", "; itr--; }os << "}"; return os; }
// set
template <typename T>ostream& operator<<(ostream & os, set<T> & set_var) { os << "{"; repi(itr, set_var) { os << *itr; itr++; if (itr != set_var.end()) os << ", "; itr--; }os << "}"; return os; }


int dp[50];

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	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++: #include <iostream>
#include <vector>

using namespace std;

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

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

long dp[50];

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

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

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

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

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

vector<int> fibonacci_list(45,0);

int fibonacci(int n){
    int f;
    if(fibonacci_list.at(n)!=0){
        f=fibonacci_list.at(n);
    }else{
        f=fibonacci(n-1)+fibonacci(n-2);
        fibonacci_list.at(n)=f;
    }
    return f;
}

int main(){
    fibonacci_list.at(0)=1;
    fibonacci_list.at(1)=1;
    int n;
    cin >> n;
    cout << fibonacci(n) << endl;
    return 0;
}

C++: #include <iostream>

int dp[50];

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

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

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

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

  int fb = fib(n);
  std::cout << fb << std::endl;

}

C++: #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
using namespace std;
double F[45];

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

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

C++: #include<cstdio>
#include<iostream>
#include<algorithm>
#include<utility>
#include<vector>
#include<queue>
#include<functional>
#include<map>
#include<set>
#include<cstring>
#include<string>
#include<stack>
#include<math.h>
#include<stdlib.h>
using namespace std;
//#define int long long
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef pair<int, char> pic;
typedef priority_queue<pii, vector<pii>, greater<pii> > RPQ;
#define mk make_pair
#define INF (1 << 30)
#define INFL (1ll << 60ll)
#define mod 1000000007

int N, fib[50];

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


    return 0;
}

/*

*/

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

#define REP( i, n) for( int i = 0; i < (n); ++i)
#define FOR( i, a, b) for( int i = (a); i < (b); ++i)

#define pb push_back

const int INF = 100100100;
const int MOD = (int)1e9 + 7;

using ll = long long;

using namespace std;

ll f( int n){
  if( n == 0) return 1;
  if( n == 1) return 1;

  return f(n-1)+f(n-2);
}

int main(){

  int x;
  

  cin >> x;
  cout << f(x) << endl;

}

C++: #include<iostream>
long dp[50];
int fib(int n){
	if (n == 0 || n == 1)
		return 1;
	else{
		if (dp[n]==0)
		    return (dp[n] = fib(n - 1) + fib(n - 2));
		else return dp[n];
	}
}
int main(){
	int n;
	std::cin >> n;
		std::cout << fib(n) << "\n";
}

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

const int MAX = 44;
int F[MAX];

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


int main() {
    ios::sync_with_stdio(false);

    F[0] = F[1] = 1;
    for(int i=2; i<MAX; i++) F[i] = -1;

    int n;
    cin >> n;
    cout << fib(n);
    return 0;
}

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

int F[50];

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

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

int n, arr[100000];

int solve(int n) {
	arr[0]=arr[1]=1;
	for (int i = 2; i <= n; i++) arr[i] = arr[i-2]+arr[i-1];
	return arr[n];
}

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

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

int dp[44];

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

	if (n == 0 || n == 1) {
		res = 1;
	}
	else {
		res = fib(n - 1) + fib(n - 2);
	}

	dp[n] = res;
	return res;
}

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

	return 0;
}

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

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