Go: package main

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

var (
	nstr   func() string
	stdout *bufio.Writer
)

func init() {
	nstr = newReadString(os.Stdin)
	stdout = bufio.NewWriter(os.Stdout)
}

func main() {
	defer stdout.Flush()
	n := nint()
	r := fibonacci(n)
	fmt.Println(r)
}

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

	}

}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

func nint64() int64 {
	i, err := strconv.ParseInt(nstr(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func nint() int {
	return int(nint64())
}

func getIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = nint()
	}
	return b
}

func getStringSlice(n int) []string {
	b := make([]string, n)
	for i := 0; i < n; i++ {
		b[i] = nstr()
	}
	return b
}

func gcd(x, y int) int {
	if y == 0 {
		return x
	}
	return gcd(y, x%y)
}

func lcm(x, y int) int {
	return x * y / gcd(x, y)
}

func contains(s []int, e int) bool {
	for _, a := range s {
		if a == e {
			return true
		}
	}
	return false
}

func bin(i int, prefix bool) string {
	i64 := int64(i)

	if prefix {
		return "0b" + strconv.FormatInt(i64, 2)
	} else {
		return strconv.FormatInt(i64, 2)
	}
}

func strReverse(s string) string {
	runes := []rune(s)
	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
		runes[i], runes[j] = runes[j], runes[i]
	}

	return string(runes)
}

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

using namespace std;

int fiv(int a[], int n){
    if(a[n])return a[n];
    if(n == 0)return a[n] = 1;
    if(n == 1)return a[n] = 1;
    return a[n] = fiv(a, n-1) + fiv(a, n-2);
}

int main(void){
    int n;
    cin >> n;
    int a[n+1];
    for(int i = 0; i <= n; i++)a[i] = 0;
    fiv(a, n);
    cout << a[n] << endl;
}

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

int F[10000];

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

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

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;
}