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>
using namespace std;

int f[45] = {};

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 if (f[n] != 0)return f[n];
	else return f[n] = fib(n - 1) + fib(n - 2);
}

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

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

#define INF 1e9
vector<ll> memo;
ll fib(int a){
  if(a == 0 || a== 1){
    return 1;
  }
  if(memo[a] != -1){
    return memo[a];
  }
  return memo[a] = (fib(a-1) + fib(a-2));
}

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

C++: /*
 * ALDS1_10_A.cpp
 *
 *  Created on: May 5, 2018
 *      Author: 13743
 */

#include<iostream>

using namespace std;

int F[44];

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

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

	F[0] = F[1] = 1;

	cout << fib(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){
  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++: #include <iostream>
using namespace std;
int num;

int fib(int n) {
    if (n ==0 || n == 1) {
        return 1;
    }
    return fib(n-1) + fib(n - 2);
}
int main(void) {
    cin >> num;
    cout << fib(num) << endl;
    
    
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cassert>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define rep(i,n) FOR(i,0,n)
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define vint vector<int>
#define vdouble vector<double>
#define vstring vector<string>
using namespace std;

#include<map>
#include<set>
#include<queue>

typedef long long ll;
typedef unsigned long long ull;

const int MAX_N = 1000000;
ll mem[MAX_N];
int N;
int main() {

	int ret;
	cin >> N;
	mem[0] = 1;
	mem[1] = 1;
	rep(i, N+1){
		if (i >= 2) mem[i] = mem[i - 1] + mem[i - 2];
	}
	cout << mem[N] << endl;
}

C++: #include<stdio.h>
using namespace std;

int f[50]={1,1};

void Fibonacci(){
    for(int i=2;i<45;i++) f[i]=f[i-1]+f[i-2];
}

int main(){
    Fibonacci();
    int n;
    scanf("%d",&n);
    printf("%d\n",f[n]);
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define rep2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
#define EPS (1e-10)
typedef long long Int;
typedef pair<Int, Int> P;
typedef pair<int, int> pint;
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin>>n;
    vector<Int> dp(n+1,0);
    dp[0]=1;
    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++: #include <iostream>
#include <iomanip>
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <sstream>
#include <string>
#include <utility>
#include <map>
#include <memory>
#include <set>
#include <vector>
#include <deque>
#include <list>
#include <stack>
#include <queue>
#include <array>

using namespace std;

class Fibonacci
{
public:
  array<int,45> f;
  int fib( int n );
  int init();
};

int Fibonacci::init()
{
  for ( auto& i : f )
    i = -1;

  f[0] = 1;
  f[1] = 1;

  return 0;
}

int Fibonacci::fib( int n )
{
  if ( f[n] > 0 )
    return f[n];

  int ret = fib( n - 1 ) + fib( n - 2 );
  f[n] = ret;

  return ret;
}

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

  Fibonacci f;

  f.init();
  cout << f.fib( n ) << endl;

  return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cctype>
#include <climits>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <list>
#include <queue>
#include <deque>
#include <algorithm>
#include <numeric>
#include <utility>
#include <complex>
#include <memory>
#include <functional>
 
using namespace std;
 
#define ALL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i <= n; i++) //変数,初期値,終値
#define rep(i,n) REP(i,0,n)
#define F(i,j,k) fill(i[0],i[0]+j*j,k)
#define P(p) cout<<(p)<<endl;
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define INF 1<<25
#define pb push_back
 
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<double> vd;
typedef pair<int,int> pii;
typedef pair<long,long> pll;
typedef long long ll;

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

C++: #include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <cstdlib>
using namespace std;

const int MAX = 55;
int n;
int dp[MAX];

int solve(int n) {
    if (dp[n] != -1) return dp[n];
    return dp[n] = (solve(n-1) + solve(n-2));
}

int main() {
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    memset(dp, -1, sizeof(dp));
    dp[0] = 1;
    dp[1] = 1;
    scanf("%d", &n);
    printf("%d\n", solve(n));
    return 0;
}

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

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

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