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 <iostream>

using namespace std;

int main()
{
        int n;
        cin >> n;
        if (n <= 1) {
                cout << 1;
                return 0;
        }

        int *fib = new int[n + 1];
        fib[0] = fib[1] = 1;
        for (int i = 2; i <= n; i++) {
                fib[i] = fib[i - 1] + fib[i - 2];
        }
        cout << fib[n];
        delete [] fib;

        return 0;
}

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

int main() {
    int n, dp[45];
    cin >> n;
    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 <bits/stdc++.h>

int main()
{
	int n;
	scanf("%d", &n);
	std::vector<int64_t> table(n + 1, 1ll);
	for (int i{2}; i <= n; i++)
		table[i] = table[i - 1] + table[i - 2];
	printf("%lld\n", table[n]);

	return 0;
}

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

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

    int first = 1;
    int second = 1;
    
    for (int i = 2; i < input; ++i) {
        int third = first + second;
        first = second;
        second = third;
    }
    cout << second;
    
    return 0;
}

C++: #include<iostream>
int dp[1000000];
int main(){
	int n;
	std::cin>>n;
	dp[0]=1;
	dp[1]=1;
	for(int i=2;i<=n;i++){
		dp[i]=dp[i-1]+dp[i-2];
	}
	std::cout<<dp[n]<<"\n";
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <queue>
#include <unordered_map>

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
typedef long long ll;

using namespace std;

template<class T>
vector<T> make_vec(size_t a){
    return vector<T>(a);
}
template<class T, class... Ts>
auto make_vec(size_t a, Ts... ts){
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

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

C++: #include<stdio.h>
#include<cstdlib>

#define MAX 44

int fibonacci(int n){
  int i, F[MAX];
  F[0] = 1;
  F[1] = 1;
  for(i = 2; i < n+1; i++){
    F[i] = F[i-1] + F[i-2];
  }
  return F[i-1];
}

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

  printf("%d\n", fibonacci(n));
}

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

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

  // n???0???1?????£?????????????????????
  if(n <= 1){ cout << 1 << endl; }
  else{
    // n???2??\????????£??????dp??????
    vector<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 << n << endl;
  }

  return 0;
}

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

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

int main(void){
	int l;
  	cin>>l;
    cout<<feb(l)<<endl;
	return 0;
}

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


int a[50];
using namespace std;


int fibonacci(int n) {
	if (a[n] > 0)
		return a[n];

	a[n] = fibonacci(n-1) + fibonacci(n-2);
	return a[n];
}


int main() {

	fill(a,a + 50, -1);

	int n;

	cin >> n;

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

	cout << fibonacci(n) << endl;

}

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

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

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

  return 0;
}

C++: #include <stdio.h>
int main(){
int a[50],n;
a[0]=a[1]=1;
scanf("%d",&n);
for(int i=2;i<=n;i++)
a[i]=a[i-1]+a[i-2];
printf("%d\n",a[n]);
}

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

using namespace std;

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

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

C++: #include <iostream>

using namespace std;

int cache[45];

int fibonacci(int n) {
    if (cache[n] != -1) {
        return cache[n];
    } else {
        int ret = fibonacci(n - 1) + fibonacci(n - 2);
        cache[n] = ret;
        return ret;
    }
}

int main() {
    for (int i = 0; i < 45; ++i)
        cache[i] = -1;
    cache[0] = cache[1] = 1;

    int n;
    cin >> n;
    cout << fibonacci(n) << '\n';
}

C++: #include<iostream>

using namespace std;

int fib(int n);

int memo[1000];

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 <cstdio>

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

    return 0;
}

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

using Lint=long long;

int main()
{
   int N; cin>>N;
   vector<int> dp(N+1);
   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<stdio.h>

int A[44];

void fibo(int n){
    A[0] = 1;
    A[1] = 1;
    for(int i=2; i<=n; i++){
        A[i] = A[i-1] + A[i-2]; //メモ化
    }
}

int main(){

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

    fibo(n);
    printf("%d\n", A[n]);
    return 0;
}