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++: #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <cstdlib>
#include <string>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <random>
#include <map>

using namespace std;

int fibArray[50];

void makeFibArray() {
    for (int i = 2; i <= 46; i++) {
	fibArray[i] = fibArray[i - 1] + fibArray[i - 2];
    }
}

int main() {

    //cin.tie(0);
    //ios::sync_with_stdio(false);

    int n; scanf("%d", &n);
    fibArray[0] = 1;
    fibArray[1] = 1;
    makeFibArray();
    printf("%d\n", fibArray[n]);


    return 0;

}

C++: #include<iostream>

using namespace std;

int fib(int n);

int main() {
  int n;

  //入力
  cin >> n;

  //出力
  cout << fib(n) << endl;

  return 0;
}

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

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 <stdio.h>

using namespace std;

long long Fibonacci[43] = {0};

long long fibo(int n){
	if(n == 0)	return 1;
	else if(n == 1)	return 1;
	else{
		if(Fibonacci[n-1] != 0 && Fibonacci[n-2] != 0){
			//Do nothing
		}else if(Fibonacci[n-1] != 0){
			Fibonacci[n-2] = fibo(n-2);
		}else if(Fibonacci[n-2] != 0){
			Fibonacci[n-1] = fibo(n-1);
		}else{
			Fibonacci[n-1] = fibo(n-1);
			Fibonacci[n-2] = fibo(n-2);
		}
		return Fibonacci[n-1] + Fibonacci[n-2];
	}
}

int main(){
	int n;
	scanf("%d",&n);
	printf("%lld\n",fibo(n));
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1e9+7,MAX = 1e5;

int hibo[50];

int fibo(int i)
{	
	if(i==0||i==1)return hibo[i] = 1;
	if(hibo[i]!=0)return hibo[i];
	return hibo[i] = fibo(i-1)+fibo(i-2);
}

int main()
{
	int n;cin >> n;
	cout<<fibo(n)<<endl;
	return 0;
}

C++: #include <iostream>
using namespace std;
 
int main() {
	int fib[45]={1,1},i;
for(i=1;i<=44;i++){
fib[i]=fib[i-1]+fib[i-2];
}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
using ll=long long;
using vec=vector<ll>;
using mat=vector<vec>;
#define For(i,a,b) for(i=a;i<b;i++)
#define rep(i,N) For(i,0,N)
#define rep1(i,N) For(i,1,N)
#define all(v) (v).begin(),(v).end()
#define allr(v) (v).rbegin(),(v).rend()
#define vsort(v) sort(all(v))
#define vrsort(v) sort(allr(v))
#define mod 1000000007
using datas=pair<ll,ll>;
using tdata=pair<datas,ll>;

long mmid(long a,long b,long c){return a<b?(b<c?b:max(a,c)):(b>c?b:min(a,c));}

ll modinv(ll a) {
  ll b=mod,u=1,v=0,t;
  while(b){
    t=a/b;
    a-=t*b; swap(a,b);
    u-=t*v; swap(u,v);
  }
  return (u+mod)%mod;
}

ll moddevide(ll a,ll b){return (a*modinv(b))%mod;}

ll modncr(ll n,ll r){
  ll i,plus=1;
  rep(i,r){
    plus=(plus*(n-i))%mod;
    plus=moddevide(plus,i+1);
  }
  return plus;
}

ll modncrlistp[200000],modncrlistm[200000];

ll modncrs(ll n,ll r){
  ll i,j;
  if(modncrlistp[n]==0){
    for(i=n;i>=0;i--){
      if(modncrlistp[i])break;
    }
    if(i<0){
      modncrlistp[0]=1;
      rep1(i,n+1){
        modncrlistp[i]=(modncrlistp[i-1]*i)%mod;
      }
    }else{
      For(j,i+1,n+1){
        modncrlistp[j]=(modncrlistp[j-1]*j)%mod;
      }
    }
  }
  if(modncrlistm[n]==0){
    for(i=n;i>=0;i--){
      if(modncrlistm[i])break;
    }
    if(i<0){
      modncrlistm[0]=1;
      rep1(i,n+1){
        modncrlistm[i]=(modncrlistm[i-1]*modinv(i))%mod;
      }
    }else{
      For(j,i+1,n+1)modncrlistm[j]=(modncrlistm[j-1]*modinv(j))%mod;
    }
  }
  return (((modncrlistp[n]*modncrlistm[r])%mod)*modncrlistm[n-r])%mod;
}

ll euclidean_gcd(ll a, ll b) {
  if(a<b) return euclidean_gcd(b, a);
  ll r;
  while ((r=a%b)){a=b;b=r;}
  return b;
}

ll countdigits(ll n){
  ll ans=0;
  while(n){n/=10;ans++;}
  return ans;
}

ll sumdigits(ll n){
  ll ans=0;
  while(n){ans+=n%10;n/=10;}
  return ans;
}

void printmap(vector<ll>& a,ll H,ll W){
  ll i,j;
  For(i,0,H+2){
    For(j,0,W+2){cout<<a[i*(W+2)+j];}
    cout<<endl;
  }
}
void inputmap(vector<ll>& a,ll H,ll W){
  ll i,j;
  string ss;
  For(i,1,H+1){
    cin>>ss;
    For(j,1,W+1){
      if(ss[j-1]=='#'){
        a[i*(W+2)+j]=1;
      }else{
        a[i*(W+2)+j]=0;
      }
    }
  }
}
ll lpow(ll a,ll b){
  ll i,res=1;
  rep(i,b){
    res*=a;
  }
  return res;
}

struct unionfind{
  vector<ll> par,treesize;
  unionfind(ll N){
    par.resize(N);
    for(ll i=0;i<N;i++)par[i]=i;
    treesize.resize(N);
    for(ll i=0;i<N;i++)treesize[i]=1;
  }
  ll root(ll x){
    ll r;
    if(par[x]==x)return x;
    r=root(par[x]);
    if(par[x]!=r){
      treesize[r]+=treesize[x];
      treesize[x]=0;
      par[x]=r;
    }
    return r;
  }
  void unite(ll x,ll y){
    ll px=root(x);
    ll py=root(y);
    if(px!=py){
      par[px]=py;
      treesize[py]+=treesize[px];
      treesize[px]=0;
    }
  }
  bool parcheck(ll x,ll y){
    ll px=root(x);
    ll py=root(y);
    return px==py;
  }
  ll size(ll x){
    ll px=root(x);
    return treesize[px];
  }
};

int main(){
  ll i,j=0,N,M,cnt=0;
  cin>>N;
  vec v(N+1,1);
  if(N<2){cout<<1<<endl;return 0;}
  For(i,2,N+1){
    v[i]=v[i-1]+v[i-2];
  }
  cout<<v[N]<<endl;
}

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

int fib(int n, int a, int b);

int main()
{
	int n;
	cin >> n;
	cout << fib(n - 1, 1, 1) << endl;
	return (0);
}


int fib(int n, int a, int b){
	int f;
	f = a;
	if (n >= 1){
		return(fib(n - 1, a + b, a));
  }
	else {
	  return (f);
	}
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
vector<int> fibonacci;
int main(void){
    int n;
    cin >> n;
    int b = 1;
    int c = 1;
    fibonacci.push_back(b);
    fibonacci.push_back(c);
    for(int i=2;i<n;i++){
        int a = b + c;
        fibonacci.push_back(a);
        c = b;
        b = a;
    }
    cout << fibonacci[n-1] + fibonacci[n-2] << endl;
    return 0;
}