Go: package main

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

const (
	initialBufSize = 100000
	maxBufSize     = 1000000
)

var sc *bufio.Scanner

func initScanner(r io.Reader) *bufio.Scanner {
	buf := make([]byte, initialBufSize)

	sc := bufio.NewScanner(r)
	sc.Buffer(buf, maxBufSize)
	sc.Split(bufio.ScanWords) // bufio.ScanLines
	return sc
}

func main() {
	sc = initScanner(os.Stdin)
	fmt.Println(resolve(parseProblem()))
}

func parseProblem() int {
	return scanInt(sc)
}

func resolve(n int) int {
	dp := make([]int, n+1)
	dp[0], dp[1] = 1, 1
	for i := 2; i <= n; i++ {
		dp[i] = dp[i-1] + dp[i-2]
	}
	return dp[n]
}

// snip-scan-funcs
func scanInt(sc *bufio.Scanner) int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return int(i)
}
func scanString(sc *bufio.Scanner) string {
	sc.Scan()
	return sc.Text()
}

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;
}