Go: package main

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

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	n, err := nextInt(sc)
	if err != nil {
		panic(err)
	}
	fmt.Println(fibonacci(n, make(map[int]int)))
}

func fibonacci(x int, memo map[int]int) int {
	if x == 0 || x == 1 {
		return 1
	}
	if y, ok := memo[x]; ok {
		return y
	}
	z := fibonacci(x-1, memo) + fibonacci(x-2, memo)
	memo[x] = z
	return z
}

func nextInt(sc *bufio.Scanner) (int, error) {
	sc.Scan()
	return strconv.Atoi(sc.Text())
}

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

int main() {
  int n;
  cin >> n;
  int dp[n+1];
  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++: #ifdef DEBUG
#include "../utils.cpp"
#endif
#include <bits/stdc++.h>
/*
Problem
 
Category
DP
 
URL:
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_10_A&lang=ja

考察:


Date: 2020/04/18
*/
 

using namespace std;
using ll = int64_t;
#define int int64_t

 
/* ==== declarations ====== */
// functions
void solve();
void getInput();
 
// global variables
int n;
vector<int> dp;

/* ======================== */
int fib(int k) {
    if (dp[k] == 0) dp[k] = fib(k-1) + fib (k-2);
    return dp[k];
}

void getInput() {
    cin>>n;
    dp = vector<int>(n+1, 0);
    dp[0] = 1; dp[1] = 1;
}
 
 
void solve() {
    cout<<fib(n)<<endl;
}
 
 
 
signed main(){
    getInput();
    solve();
    return 0;
}

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

int main() {
  int a[45];
  a[0] = a[1] = 1;

  int n; cin >> n;

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

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

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    scanf("%d", &n);
    vector<long long> fib;
    fib.push_back(1);
    fib.push_back(1);
    for(int i = 2; i < 45; i++){
        long long val = fib.at(i - 1) + fib.at(i - 2);
        fib.push_back(val);
    }
    cout << fib.at(n) << endl;
}

C++: #include <iostream>

using namespace std;

int fib(int n);
int memo[45];
int main() {
    int n;

    //??\???
    cin >> n;

    //??????
    cout << fib(n) << endl;

    return 0;
}

int fib(int n){
  /* ??????1 */
  if(n==0||n==1)    return 1;
  else if(memo[n]!=0){
    return memo[n];
  }else{
    return memo[n]=fib(n-1)+fib(n-2);
  }
}

C++: #define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i<=b;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define vi vector<int>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int> >
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define MEMSET(a) memset(a,0,sizeof(a))
#define inf (1ll<<60)

using namespace std;

const int mod=1e9+7;

void run();

void init() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(12);
}

signed main(){
    init();
    run();
    return 0;
}

void run(){
    int n;
    cin>>n;
    vi f(n+1);
    f[0]=f[1]=1;
    REP(i,2,n){
        f[i]=f[i-1]+f[i-2];
    }
    cout<<f[n]<<endl;
}

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

C++: #include <iostream>

using namespace std;

typedef long long signed int ll;

constexpr ll NIL = -20000000000;

ll dp[50];

ll fib(int n) {
    if(n < 3) return n;
    if(dp[n] == 0) dp[n] = fib(n-1) + fib(n-2);
    return dp[n];
}

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

C++: #include <iostream>
using namespace std;
long long fibo(int n){
    long long fibodp[200];
        fibodp[0]=1;
        fibodp[1]=1;
        for(int i=2; i<=n; i++){
            fibodp[i]=fibodp[i-1]+fibodp[i-2];
        }
        return fibodp[n];
}
int main(void){
    int n;
    
    cin>>n;
    std::cout << fibo(n) << std::endl;
    return 0;
    
}

C++: #include <bits/stdc++.h>
#define r(i,a,n) for(int i=a;i<n;i++)
using namespace std;
int main(){
  int f[45];
  f[0]=f[1]=1;
  r(i,2,45)f[i]=f[i-1]+f[i-2];
  int a;cin>>a;
  cout<<f[a]<<endl;
}

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

using namespace std;

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

	long long int f[45];
	int n; cin >> n;

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

	cout << f[n] << "\n";

	return 0;
}

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

int dp[45];

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 < 45; i++) {
		dp[i] = -1;
	}
	int n;
	cin >> n;
	cout << fib(n) << endl;

	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <stack>
#include <algorithm>
#include <iostream>
#include <string>
#include <map>
#include <queue>
#include <stdio.h>
#include <math.h>


using namespace std;

typedef long long ll;

typedef vector<vector<int>> vvi;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vector<string>> vvs;
typedef vector<ll> vll;

typedef pair<int, int> P;

typedef queue<int> qi;
typedef queue<string> qs;


#define rep(i, n) for(int i=0; i<(n); ++i)
#define repp(i, a, b) for(int i = (a); i <= (b); i++)
#define Rep(i, n) for(int i=n; i >= 0; i--)

#define all(v) v.begin(), v.end()
//sort( all(v) )　などと使える

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

	vi fib(60, 1);
	rep(i, 50) fib[i + 2] = fib[i + 1] + fib[i];

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

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

int n;
int F[45];
int fibo(int i) {
    if (F[i]) {
        return F[i];
    }
    F[i] =  fibo(i - 1) + fibo(i-2);
    return F[i];
}

int main() {
    cin >> n;
    F[0] = F[1] = 1;
    cout << fibo(n);

    return 0;
}

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

int main(){
   int n;cin>>n;
   int F[50];

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

C++: #include "bits/stdc++.h"
using namespace std;
using ll = long long; using ull = unsigned long long;
#define int ll
using vb = vector<bool>; using vvb = vector<vb>;
using vi = vector<int>; using vvi = vector<vi>;
using vl = vector<ll>; using vvl = vector<vl>;
using pii = pair<int,int>; using pll = pair<ll,ll>;
#define FOR(i,a,b) for(ll i = (a); i < (ll)(b); ++i)
#define REP(i,n) FOR(i,0,n)
#define RFOR(i,a,b) for(ll i = (ll)(b)-1;i >= a;--i)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define eb(val) emplace_back(val)
const double PI = acos(-1);
const double EPS = 1e-10;
const ll MOD = 1e9+7;
void cioacc(){//accelerate cin/cout
  cin.tie(0);
  ios::sync_with_stdio(false);
}
pair<vl,vb> eratosthenes_sieve(ll n){
  vb is_prime(n+1,true);
  vl prime;
  is_prime[0] = false;
  is_prime[1] = false;
  FOR(i,2,sqrt(n)+1){
    if(!is_prime[i]) continue;
    for(ll j=2*i;j<=n;j+=i) is_prime[j] = false;
    prime.eb(i);
  }
  return {prime,is_prime};
}
signed main(){
  int n;
  cin >> n;
  vi fib(n+1,1);
  REP(i,n-1) fib[i+2] = fib[i+1]+fib[i];
  cout << fib[n] << endl;
}