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 <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <climits>
#include <string>
#include <vector>
#include <utility>

using namespace std;

typedef long long ll;
typedef pair<int, int> P;

#define REP(i, n) for (ll i = 0; i < n; i++)
#define REPR(i, n) for (ll i = n; i >= 0; i--)
#define FOR(i, m, n) for (ll i = m; i < n; i++)

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

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

using namespace std;
typedef long long ll;
typedef long int li;
typedef long double lb;
#define rep(i,j,n) for (ll i = j; i < (n); i++)
#define repr(i,j,n) for(ll i = j; i >= (n); i--)
#define all(x) (x).begin(),(x).end()
#define CLR(mat,f) memset(mat, f, sizeof(mat))
#define IN(a, b, x) (a<=x&&x<b)
#define out(ans) cout << ans << endl
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
typedef pair<ll,ll>P;
const ll mod=1e9+7;
const ll INF = 1LL<<60;
const ll m=1LL<<32;

int main(){

  ll n;cin>>n;
  ll fib[50];
  fib[0]=fib[1]=1;
  rep(i,2,50){
    fib[i]=fib[i-1]+fib[i-2];
  }

  out(fib[n]);

  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;

ll memo[55];

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

int main() {
    fib(50);
    int n;
    cin >> n;
    cout << memo[n] << endl;
}

C++: #include<cstdio>
#include<cstdlib>
#include<iostream>
using namespace std;
int main() {
  int n;
  int dp[44] = {};
  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-1] << endl;
}

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


int fibonacci(int n) {
    int fib[50];
    fib[0] = fib[1] = 1;
    
    for (int i = 2; i <= n; i++) {
        fib[i] = fib[i-1] + fib[i-2];
    }

    return fib[n];
}

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

    cout << fibonacci(n) <<endl;

    return 0;
}

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

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

C++: #include <iostream>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define NIL -1
#define MAX 10000

int dp[50];


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

int main()
{
    int n;
    rep(i, 50) dp[i] = -1;

    cin >> n;
    cout << fibonacci(n) << endl;

    return 0;
}

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

void make_fib(vector<int>& fib){
  for(int i=2; i<fib.size(); i++){
    fib[i] = fib[i-1] + fib[i-2];
  }
}

int main(){
  vector<int> fib(50,1);
  make_fib(fib);
  int n; cin >> n;
  cout << fib[n] << "\n";
}

C++: #include <cstdio>

int fibo(int n, int *dp) {
    if (n == 0 || n == 1) return 1;
    if (0 < dp[n]) return dp[n];
    return fibo(n-1, dp) + fibo(n-2, dp);
}

int
main ()
{
    int n;
    int dp[50];
    for (int i=0; i<50; i++) dp[i] = -1;
    scanf("%d", &n);
    printf("%d\n", fibo(n, dp));
    return 0;
}

C++: #include<map>
#include<set>
#include<list>
#include<cmath>
#include<queue>
#include<stack>
#include<cstdio>
#include<string>
#include<vector>
#include<complex>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<numeric>
#include<sstream>
#include<iostream>
#include<algorithm>
#include<functional>

#define MP make_pair
#define PB push_back
#define ALL(x) (x).begin(),(x).end()
#define REP(i,n) for(int i=0;i<(n);i++)
#define REP1(i,n) for(int i=1;i<(n);i++)
#define REP2(i,d,n) for(int i=(d);i<(n);i++)
#define RREP(i,n) for(int i=(n);i>=0;i--)
#define CLR(a)      memset((a),0,sizeof(a))
#define MCLR(a)     memset((a),-1,sizeof(a))
#define RANGE(x,y,maxX,maxY) (0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI > VVI;
typedef vector<string> VS;
typedef vector<LL> VLL;
typedef pair<int,int> PII;

const int INF = 0x3f3f3f3f;
const LL INFL = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-9;

const int DX[]={1,0,-1,0},DY[]={0,-1,0,1};

#define max 44

int fib(int n){
	int i,dp[max]={1,1};
	for(i=2;i<=n;i++)
		dp[i]=dp[i-1]+dp[i-2];
	return dp[n];
}

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

C++: #include<iostream>
using namespace std;
  
typedef long long hyper;
  
hyper fib(int n)
{
    if(n < 2) return 1;
    if(n == 2) return 2;
    if(n == 3) return 3;
    return 3 * fib(n - 2) - fib(n - 4);
}
   
int main()
{
    int n;
    cin >> n;
    cout << fib(n) << endl;
    return 0;
}

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

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

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