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>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;

int main() {
  int n;
  cin >> n;
  int dp[n+1];
  dp[0] = 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++: #ifdef DEBUG
#include "../utils.cpp"
#endif
#include <bits/stdc++.h>
/*
Problem
 
Category
DP
 
URL:
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_10_A&lang=ja

考察:


Date: 2020/04/18
*/
 

using namespace std;
using ll = int64_t;
#define int int64_t

 
/* ==== declarations ====== */
// functions
void solve();
void getInput();
 
// global variables
int n;
vector<int> dp;

/* ======================== */
int fib(int k) {
    if (dp[k] == 0) dp[k] = fib(k-1) + fib (k-2);
    return dp[k];
}

void getInput() {
    cin>>n;
    dp = vector<int>(n+1, 0);
    dp[0] = 1; dp[1] = 1;
}
 
 
void solve() {
    cout<<fib(n)<<endl;
}
 
 
 
signed main(){
    getInput();
    solve();
    return 0;
}

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

int main() {
  int a[45];
  a[0] = a[1] = 1;

  int n; cin >> n;

  for (int i = 2; i <= n; i++)
    a[i] = a[i-1] + a[i-2];

  cout << a[n] << endl;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    scanf("%d", &n);
    vector<long long> fib;
    fib.push_back(1);
    fib.push_back(1);
    for(int i = 2; i < 45; i++){
        long long val = fib.at(i - 1) + fib.at(i - 2);
        fib.push_back(val);
    }
    cout << fib.at(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){
  /* ??????1 */
  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++: #define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i<=b;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define vi vector<int>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int> >
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define MEMSET(a) memset(a,0,sizeof(a))
#define inf (1ll<<60)

using namespace std;

const int mod=1e9+7;

void run();

void init() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(12);
}

signed main(){
    init();
    run();
    return 0;
}

void run(){
    int n;
    cin>>n;
    vi f(n+1);
    f[0]=f[1]=1;
    REP(i,2,n){
        f[i]=f[i-1]+f[i-2];
    }
    cout<<f[n]<<endl;
}

C++: #include<iostream>
using namespace std;
int main(){
	int a[45];
	a[0]=0;
	a[1]=1;
	int n,i;
	cin>>n;
	if(n>=2){
		for(i=2;i<=n;i++){
			a[i]=a[i-1]+a[i-2];
		}
	}
	cout<<a[n]<<endl;
	return 0;
}

C++: #include <iostream>

using namespace std;

typedef long long signed int ll;

constexpr ll NIL = -20000000000;

ll dp[50];

ll fib(int n) {
    if(n < 3) return n;
    if(dp[n] == 0) dp[n] = fib(n-1) + fib(n-2);
    return dp[n];
}

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

C++: #include <iostream>
using namespace std;
long long fibo(int n){
    long long fibodp[200];
        fibodp[0]=1;
        fibodp[1]=1;
        for(int i=2; i<=n; i++){
            fibodp[i]=fibodp[i-1]+fibodp[i-2];
        }
        return fibodp[n];
}
int main(void){
    int n;
    
    cin>>n;
    std::cout << fibo(n) << std::endl;
    return 0;
    
}

C++: #include <bits/stdc++.h>
#define r(i,a,n) for(int i=a;i<n;i++)
using namespace std;
int main(){
  int f[45];
  f[0]=f[1]=1;
  r(i,2,45)f[i]=f[i-1]+f[i-2];
  int a;cin>>a;
  cout<<f[a]<<endl;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>

using namespace std;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);

	long long int f[45];
	int n; cin >> n;

	f[0] = 1; f[1] = 1;
	for(int i=2;i<=n;i++) f[n] = f[n-1] + f[n-2];

	cout << f[n] << "\n";

	return 0;
}

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

int dp[45];

int fib(int n) {
	if (dp[n] != -1)return dp[n];
	int res;

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

	dp[n] = res;
	return res;
}

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

	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <stack>
#include <algorithm>
#include <iostream>
#include <string>
#include <map>
#include <queue>
#include <stdio.h>
#include <math.h>


using namespace std;

typedef long long ll;

typedef vector<vector<int>> vvi;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vector<string>> vvs;
typedef vector<ll> vll;

typedef pair<int, int> P;

typedef queue<int> qi;
typedef queue<string> qs;


#define rep(i, n) for(int i=0; i<(n); ++i)
#define repp(i, a, b) for(int i = (a); i <= (b); i++)
#define Rep(i, n) for(int i=n; i >= 0; i--)

#define all(v) v.begin(), v.end()
//sort( all(v) )　などと使える

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

	vi fib(60, 1);
	rep(i, 50) fib[i + 2] = fib[i + 1] + fib[i];

	cout << fib[n] << endl;
}

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

int n;
int F[45];
int fibo(int i) {
    if (F[i]) {
        return F[i];
    }
    F[i] =  fibo(i - 1) + fibo(i-2);
    return F[i];
}

int main() {
    cin >> n;
    F[0] = F[1] = 1;
    cout << fibo(n);

    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main(){
   int n;cin>>n;
   int F[50];

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