Go: package main

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

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 500001), 500000)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func main() {
	fp := os.Stdin
	if len(os.Args) > 1 {
		fp, _ = os.Open(os.Args[1])
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(os.Stdout)

	n := getNextInt(scanner)

	fmt.Fprintln(writer, fib(n))
	writer.Flush()

}

func fib(n int) int {
	if n <= 1 {
		return 1
	}
	dp := make([]int, n+1)
	dp[0] = 1
	dp[1] = 1
	for i := 2; i <= n; i++ {
		dp[i] = dp[i-2] + dp[i-1]
	}
	return dp[n]
}

C++: #include<bits/stdc++.h>
using namespace std;
long long fib[100];
long long fibonacci(long long n)
{
    if(fib[n])
        return fib[n];
    if(n<=1) return n;
    return fib[n]=fibonacci(n-2)+fibonacci(n-1);
}

int main()
{
    long long n;
    cin>>n;
    fibonacci(n);
    cout<<fibonacci(n+1)<<endl;
    return 0;
}

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

// macro
#define rep(i,n) for(i=0;i<n;i++)
#define ll long long
#define all(v) v.begin(), v.end()

// code starts
int main()
{
  int n;cin>>n;
  int i;
  vector<int> dp(n+1);
  dp[0]=1;
  dp[1]=1;
  rep(i,n-1)dp[i+2]=dp[i+1]+dp[i];
  cout<<dp[n]<<endl;
}

C++: #include <cstdio>
#include <cstdlib>

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

void init()
{
    for (int i = 0; i < MAX; i++) {
        fibo_res[i] = -1;
    }
}

int fibonacci(int n)
{
    if (n == 0 || n == 1) {
        return 1;
    }
    if (fibo_res[n-1] != -1 && fibo_res[n-2] != -1) {
        return fibo_res[n-1] + fibo_res[n-2];
    } else {
        int res = fibonacci(n-1) + fibonacci(n-2);
        fibo_res[n] = res;
        return res;
    }
}

int main(int argc, char *argv[])
{
    init();
    int n;
    scanf("%d", &n);
    fprintf(stdout, "%d\n", fibonacci(n));
}

C++: #include <bits/stdc++.h>
using namespace std;
template<typename T>
ostream& operator<<(ostream& os, const vector<T>& v){
  const char* dlm = "";
  for(const auto& x:v) cout << exchange(dlm, "\t") << x;
  return os;
}
int32_t main(){
  size_t n; cin>>n;
  size_t f[45];
  f[0]=1; f[1]=1;
  for(size_t i=2; i<45; ++i) f[i]=f[i-1]+f[i-2];
  cout<<f[n]<<endl;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define lper(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define ins insert
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
using vpl=vector<pl>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={1,0,-1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
ll modfac(ll a){
    ll ans=1;
    while(a>1){
        ans*=a;
        ans%=1000000007;
        a--;
    }
    return ans;
}
ll modinv(ll a,ll m) {
    ll b = m, u = 1, v = 0;
    while (b) {
        ll t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m; 
    if (u < 0) u += m;
    return u;
}
struct UnionFind {
    vector<int> par;
    
    UnionFind(int n) : par(n, -1) {}

    int root(int x) {
        if (par[x] < 0) return x;
        else return par[x] = root(par[x]);
    }
    
    bool same(int x, int y) {
        return root(x) == root(y);
    }
    
    bool merge(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (par[x] > par[y]) swap(x, y);
        par[x] += par[y];
        par[y] = x;
        return true;
    }
    
    int size(int x) {
        return -par[root(x)];
    }
};
ll modpow(ll a, ll n, ll mod) {
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
int main(){
    ll n;cin >> n;
    vl dp(45,0);
    dp[0]=1;
    dp[1]=1;
    rep(i,43){
        dp[i+2]=dp[i+1]+dp[i];
    }
    cout << dp[n] <<endl;
}

C++: #include <iostream>
using namespace std;
static const int MAX = 45;
int F[MAX];

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

int main()
{
    for (int i = 0; i != MAX; ++i)
    {
        F[i] = 0;
    }
    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]=1;
    /* ??????3-2 */
    dp[1]=1;
    //??\???
    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++: 
f = [-1 for i in range(45)]
f[0] = f[1] = 1

def fib(n):
    global f
    for i in range(2,n+1):
        f[i] = f[i - 1] + f[i - 2]
        #print(i,f[i])
    return f[n]

if __name__ == "__main__":
    n = input("input number: ")
    n = int(n)
    #print(type(n))
    print(fib(n))

C++: #include <bits/stdc++.h>
using namespace std;
long long memo[50];
long long f(long long x){
  if(x==0||x==1)return memo[x]=1;
  if(memo[x]!=0)return memo[x];
  return memo[x]=f(x-1)+f(x-2);
}
int main() {
  int n;
  cin >>n;
  long long kotae=f(n);
  cout<<kotae<<endl;
}

C++: #include<iostream>
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <iomanip>//setprecision
#include<math.h>
#include <functional>
#include<climits>
using namespace std;
#define ll  long long 
#define rep(i, n)        for(ll i=0; i<(ll)(n); ++i)
#define mod 1000000007
ll dp[201];
int main(){
  ll a;cin>>a;
  dp[0]=1;
  dp[1]=1;
  for(ll i=2;i<=a;i++){
    dp[i]=dp[i-1]+dp[i-2];
  }
  cout<<dp[a]<<endl;
}

C++: #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define loop(i,a,b) for(i=a;i<b;i++)
#define rloop(i,a,b) for(i=a;i>=b;i--)
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
const int inf=1000000001;
const ll INF=1e16;
#define MOD 1000000007
#define mod 1000000009
#define pi 3.14159265358979323846

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