Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

// I/O
type Scanner struct {
	sc *bufio.Scanner
}

func NewScanner() *Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &Scanner{sc}
}

func (s *Scanner) nextStr() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *Scanner) nextInt() int {
	i, e := strconv.Atoi(s.nextStr())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *Scanner) nextFloat() float64 {
	f, e := strconv.ParseFloat(s.nextStr(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *Scanner) nextRuneSlice() []rune {
	return []rune(s.nextStr())
}

func (s *Scanner) nextIntSlice(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextInt()
	}
	return res
}

func (s *Scanner) nextFloatSlice(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextFloat()
	}
	return res
}

// Arithmetic
func max(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m < i {
			m = i
		}
	}
	return m
}

func min(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m > i {
			m = i
		}
	}
	return m
}

func abs(x int) int {
	if x > 0 {
		return x
	}
	return -x
}

func pow(x, y int) int {
	res := 1
	for i := 0; i < y; i++ {
		res *= x
	}
	return res
}

func ceil(a, b int) int {
	if a%b == 0 {
		return a / b
	} else {
		return a/b + 1
	}
}

// Sort
type RuneSlice []rune

func (a RuneSlice) Len() int           { return len(a) }
func (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }
func (a RuneSlice) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

// Main
func main() {
	sc := NewScanner()
	wtr := bufio.NewWriter(os.Stdout)
	N := sc.nextInt()
	dp := make([]int, N+1)
	dp[0] = 1
	dp[1] = 1
	for i := 2; i <= N; i++ {
		dp[i] = dp[i-1] + dp[i-2]
	}

	fmt.Fprintln(wtr, dp[N])
	wtr.Flush()
}

C++: /*
** 斐波那契数列 使用动态规划来避免重复的计算
*/

# include <cstdio>
# include <cstring>

const int MAX = 44 + 5;

int n, dp[MAX];

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

void solve() {
    scanf("%d", &n);
    memset(dp, 0, sizeof(dp));
    printf("%d\n", fib(n));
}

int main() {
    // freopen("infile", "r", stdin);
    // freopen("outfile", "w", stdout);
    solve();
    return 0;
}

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

long long f[10000000];

long long fib(int n)
{
  if (n == 0 || n == 1) return (1);
  if (f[n] != 0)  return (f[n]);
  else {
    f[n] = fib(n - 1) + fib(n - 2);
  }
  return f[n];
}
int main()
{
  int n;
  cin >> n;
  cout << fib(n) << endl;
}

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

template <typename TYPE>
void print_vec(const vector<TYPE>& v){
	for(int i=0; i<v.size(); i++){
		cout << v[i] << " ";
	}
	cout << endl;
}

template <typename TYPE>
void print_vec2(const vector<vector<TYPE>>& v){
	for(int i=0; i<v.size(); i++){
		cout << "i=" << i << ":   ";
		for(int j=0; j<v[i].size(); j++){
			cout << v[i][j] << "   ";
		}
		cout << endl;
	}
}



int fib(int i, vector<int> &dp){
    if(dp[i] != -1) return dp[i];
    if(i == 0) return dp[i] = 1;//dpにメモしながら返す
    if(i == 1) return dp[i] = 1;
    return dp[i] = fib(i-1, dp) + fib(i-2, dp);

}
int main(){//
   int n;
   cin >> n;
   vector<int> dp(n+5, -1);

   cout << fib(n, dp) << endl;


}

C++: #include <iostream>

long long int Fibo(long long int n)
{
    if(n == 0 || n == 1) return 1;
    return Fibo(n-1) + Fibo(n-2);
}
int main(){
    long long int n;
    std::cin >> n;
    std::cout << Fibo(n) << std::endl;
    return 0;
}

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

void fib(int n){
  int a[MAX];
  for(int i=0;i<MAX;i++) a[i]=1;
  for(int i=2;i<=n;i++){        
    a[i]=a[i-1]+a[i-2];
  }  cout << a[n] << endl;
}

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

C++: #include <cstdio>

int fibo(int n, int *dp) {
    if (n == 0 || n == 1) return 1;
    if (0 < dp[n]) return dp[n];
    return dp[n] = 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<bits/stdc++.h>
using namespace std;

int f[50];

int fibo(int n)
{
  if(n <= 1) return 1;
  else{
    if(f[n]){
      return f[n];
    }
    else{
      return f[n] = fibo(n-1)+fibo(n-2);
    }
  }
}

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

  cout << fibo(n) << endl;
  return 0;
}

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

int arr[46];

int fib(int n)
{
    if(n==1 || n==0)
    {
        return arr[n];
    }
    if(arr[n]!=-1)
        return arr[n];

    else
        arr[n]=fib(n-1)+fib(n-2);
    return arr[n];

}


int main()
{
    arr[0]=1;
    arr[1]=1;

    for(int i=2;i<=44;i++)
    {
        arr[i]=-1;
    }


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




    return 0;
}

C++: #if 0

#endif

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;

int F[100];

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

C++: #include "bits/stdc++.h"
#define Rep(i,n) for(int i=0;i<(int)(n);i++)
#define For(i,n1,n2) for(int i=(int)(n1);i<(int)(n2);i++)
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define RREP(i,n) for(ll i=((ll)(n)-1);i>=0;i--)
#define FOR(i,n1,n2) for(ll i=(ll)(n1);i<(ll)(n2);i++)
#define RFOR(i,n1,n2) for(ll i=((ll)(n1)-1);i>=(ll)(n2);i--)
#define all(a)  (a).begin(),(a).end()
#define IOS std::cin.tie(0),std::ios::sync_with_stdio(false)

namespace idaten {

	using namespace std;
	using ll = int_fast64_t;
	using ull = uint_fast64_t;
	using P = std::pair<int64_t, int64_t>;
	template<typename T1, typename T2> inline bool chmin(T1& a, T2 b) { if (a > b) { a = b; return 1; }return 0; }
	template<typename T1, typename T2> inline bool chmax(T1& a, T2 b) { if (a < b) { a = b; return 1; }return 0; }
	template<class Type>struct is_vector : std::false_type {};
	template<class ValueType, class Alloc>struct is_vector<std::vector<ValueType, Alloc>> : std::true_type {};
	template <typename T> inline std::ostream& operator << (std::ostream& out, const std::vector<T>& v) {
		if (v.empty())return out;
		constexpr bool is_vector_v = is_vector<T>::value;
		if (is_vector_v)for (auto itr = v.begin(); itr != v.end();)out << (*itr), out << ((++itr != v.end()) ? "\n" : "");
		else for (auto itr = v.begin(); itr != v.end();)out << (*itr), out << ((++itr != v.end()) ? " " : "");
		return out;
	}
	inline void put() {}
	template<class T> inline void put(const T& first) { std::cout << first << "\n"; }
	template<class T, class... N> inline void put(const T& first, const N& ... rest) { std::cout << first << " "; put(rest...); }
	inline void putn() {}
	template<class T, class... N> inline void putn(const T& first, const N& ... rest) { std::cout << first << "\n"; putn(rest...); }

	void solve() {
		IOS;
		ll n;
		cin >> n;
		vector<ll> dp(n + 1, 0);
		dp[0] = dp[1] = 1;
		FOR(i, 1, n) {
			dp[i + 1] = dp[i] + dp[i - 1];
		}
		put(dp[n]);
	}
} // namespace idaten

int main() {
	idaten::solve();
	return 0;
}

C++: #include <cstdio>
#include <algorithm>
using namespace std;
int n,dp[50];
int main()
{
	dp[0]=1;
	dp[1]=1;
	for(int i=2;i<=50;i++){
		dp[i]=dp[i-2]+dp[i-1];
	}
	scanf("%d",&n);
	printf("%d\n",dp[n]);
	return 0;
}

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

int main(void){
  int n;
  int fib[45];
  fib[0] = 1;
  fib[1] = 1;

  cin >> n;

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

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