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 <bits/stdc++.h>

using namespace std;

#define FOR(i,s,e) for((i)=(s);(i)<(int)(e);(i)++)
#define REP(i,e) FOR(i,0,e)

#define all(o) (o).begin(), (o).end()
#define psb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))

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

const double EPS = 1e-10;

const int N = 44;
int n;
int dp[N+1];

//???????£?
//recursive function(with/without memo)

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

int main() {
  memset(dp, 0, sizeof(dp));
  dp[0] = dp[1] = 1;
  scanf("%d ", &n);
  printf("%d\n", fib(n));

	return 0;
}

C++: #define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>


int fib(int n){
  
    if(n == 0 || n == 1){
        return 1;
    }
    
    int ans = 0;
    int fib_1, fib_2;
    fib_1 = 1;
    fib_2 = 1;
    
    for(int i = 2; i <= n; i++){
        ans = fib_1 + fib_2;
        fib_2 = fib_1;
        fib_1 = ans;
    }
    
    return ans;
}


int main(int argc, const char * argv[]) {
    
    //Input
    int n;
    scanf("%d", &n);
    
    printf("%d\n", fib(n));
           
    return 0;
}

C++: #include <iostream>
using namespace std;
#define NIL -1

int F[50];

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

int main() {
  int n; cin >> n;
  for (int i = 0;  i < 50; ++i) F[i] = NIL;
  cout << fibonacci(n) << endl;
}

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

long long dp[101];

long long fib(long long n){
  
  dp[0] = 0;
  dp[1] = 1;

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

  return dp[n];
}

int main(){

  long long n;

  cin>>n;

  memset(dp,0,101);

  cout<<fib(n)<<endl;

  return EXIT_SUCCESS;
}

C++: #include <iostream>

using namespace std;

int fib(int n);

int memo[45];

int main(){
  int n;

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

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

C++: #include <bits/stdc++.h>
using namespace std;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    vector<int> dp(45);
    int N;
    cin >> N;
    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>
using namespace std;

int F[50];

int main() {

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

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

unordered_map<int, int> h;

int fib(int n);

int fib(int n) {
    if (h.count(n) != 0) {
        return h[n];
    }

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

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

C++: #include <iostream>

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

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

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) << endl;

    return 0;
}

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

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

    vector<int> A(n + 1);
    A[0] = A[1] = 1;
    for (int i = 2; i <= n; i++)
    {
        A[i] = A[i - 2] + A[i - 1];
    }

    cout << A[n] << endl;

    return 0;
}

C++: #include<stdio.h>

int dp[50];

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

int main() {
  int n, i;
  for (i = 0; i < 50; i++) dp[i] = -1;

  scanf("%d", &n);
  printf("%d\n", fib(n));

  return 0;
}

C++: #include <stdio.h>

int fibonacci(int);

int fibo[44];

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

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

C++: # include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
constexpr int MOD = 1000000007;
constexpr int INF = 2000000000;
using namespace std;

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

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

// ?????£??????????????°???????±???????
int fibonacci(int n);

int main()
{
    int num;
    cin >> num;
    int res = 0;

    res = fibonacci(num);
    cout << res << endl;

    getchar();
    getchar();

    return 0;
}

int fibonacci(int n)
{
    if(n == 0) { return 1; }
    if(n == 1) { return 1; }
    return fibonacci(n-1) + fibonacci(n-2);
}

C++: #include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>

using namespace std;

int memo[45];

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

int fib1(int n) {
	return (int)(pow((1 + sqrt(5)) / 2, n) / sqrt(5) + 0.5);
}

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