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 <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#define rep(i,a,b) for(int (i)=(a);i<(b);i++)
#define INF 100000000
#define MAX_N 1000000
using namespace std;

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

C++: #include<bits/stdc++.h>
#define rep(i,n) for(int i = 0;i<n;i++)
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
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;}

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

C++: /* 以下は動的計画法を用いずにナイーブに書いたプログラム
#include<iostream>
using namespace std;

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

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

    return 0;
}
*/

#include<iostream>
using namespace std;

int fib[45] = {0};

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

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

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
const double PI = acos(-1);
const ll MOD = 1000000007;
using Graph = vector<vector<int>>;

int main() {
  int n; cin >> n;
  vector<ll> a(n+1);

  a[0] = a[1] = 1;

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

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

C++: #include <stdio.h>
#define rep(i, n) for(int i = 0; i < n; ++i)
int f[50];

void fi(int a) {
  f[a] = f[a - 2] + f[a - 1];
}

int main(void) {
  int n;
  scanf("%d", &n);
  rep(i, 50) f[i] = 0;
  f[0] = 1, f[1] = 1;
  for(int i = 2; i < 50; ++i) fi(i);
  printf("%d\n", f[n]);
  return 0;
}

C++: #include <cstdio>
#include <iostream>

using namespace std;

int fib(int n) {

	if (n == 0 || n == 1)
		return 1;

	return fib(n - 1) + fib(n - 2);
}

int main() {

	int n;
	scanf("%d", &n);

	cout << fib(n) << endl;

	return 0;

}

C++: #include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); ++i)
#define outl(x) cout<< (x) << '\n'
#define fi first
#define se second
using pii = pair<int,int>;
using ll = long long;

int main()
{
   cin.tie(0), ios::sync_with_stdio(false);
   ll fib[45] = {1, 1};

   int n;
   cin >> n;
   for (int i=2; i <= n; ++i) {
       fib[i] = fib[i-1] + fib[i-2];
   }

   outl(fib[n]);
}

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

//#include <vector>
#define ALL(l)  (l).begin(),(l).end()
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
using namespace std;
typedef long long ll;
ll mod = 1000000007;
ll maxn = 1000000000;

//---------------------------------------------------------------------------------------------------
using vi = vector<int>; // intの1次元の型に vi という別名をつける
using vvi = vector<vi>; // intの2次元の型に vvi という別名をつける
using vs = vector<string>; // stringの1次元の型に vs という別名をつける
using pii = pair<int, int>; // これ以降 pii という型名はpair<int, int> と同じ意味で使える
//---------------------------------------------------------------------------------------------------


 
int main(){
 
   
    ll n,ans;
    cin>>n;
       vi s(n+1);
        s.at(0)=1;
    s.at(1)=1;
    
    for(int i=2;i<=n;i++){
        s.at(i)=s.at(i-1)+s.at(i-2);
    }
    
    
    
    cout<<s.at(n)<<endl;
}

C++: #include <stdio.h>

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

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

int main() {
  int dp[MAX];
  dp[0] = dp[1] = 1;
  for (int i = 2; i < MAX; i++) {
    dp[i] = dp[i - 1] + dp[i - 2];
  }

  int n;
  cin >> n;
  cout << dp[n] << endl;

  return 0;
}

C++: #include <iostream>

int main()
{
    constexpr int N = 45;
    
    int dp[N] {};
    
    dp[0] = 1;
    dp[1] = 1;
    
    for(int i = 2; i < N; ++i)
        dp[i] = dp[i-1] + dp[i-2];
    
    int n;
    std::cin >> n;
    std::cout << dp[n] << std::endl;
    
    return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<stdlib.h>
#include<cstdio>
int fib(int);
using namespace std;
int main()
{
	int n,ans,dp[1001];
	dp[0] = 1;
	dp[1] = 1;
	cin >> n;
	for (int i = 0; i <= n; i++){
		dp[i + 2] = dp[i] + dp[i + 1];
	}
	//ans = fib(n - 1);
	ans = dp[n];
	cout << ans << endl;
}
int fib(int n)
{
	if (n < 1)
		return 1;
	else
	{
		return fib(n - 1)+fib(n - 2);
	}
}

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

// コンテスト中のみ
//#define int long long

#define ll long long
#define rep(i,n) for(int i = 0; i < (n); i++)
#define P pair<ll,ll>
int MOD = 1000000007;
const ll INF = 1LL << 60;

int n;
ll fib[45];
signed main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cin >> n;
	fib[0] = 1; fib[1] = 1;
	for (int i = 2; i <= 44; i++) {
		fib[i] = fib[i - 1] + fib[i - 2];
	}
	cout << fib[n] << endl;
	return 0;
}