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>
#include <string>
#include <map>
#include <set>
using namespace std;
#define MAX 100000

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

C++: #include <iostream>

using namespace std;

int fib(int n);

int main() {
    int n;
    int dp[45];

    //?????????
    /* ??????3-1 */
    dp[0]=1;
    /* ??????3-2 */
    dp[1]=1;
    //??\???
    cin >> n;

    //DP
    for (int i = 2; i <= n; i++) {
        /* ??????3-3 */
      d@[i]=dp[i-1]+dp[i-2];
    }

    //??????
    cout << dp[n] << endl;

    return 0;
}

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

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

	cout << F[n] << endl;

	return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
const int inf=1e9+7;
const ll mod=1e9+7;

int DP[45];

void fibonacci(int n){
    if(DP[n-1]==0){
        fibonacci(n-1);
    }
    if(DP[n-2]==0){
        fibonacci(n-2);
    }
    DP[n] = DP[n-1] + DP[n-2];
}

int main() {
    int n;
    cin>>n;
    DP[0] = 1;
    DP[1] = 1;
    if(n>=2){
        fibonacci(n);
    }
    cout<<DP[n]<<endl;
}

C++: #include <iostream>
using namespace std;
long long dp[45];

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

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

C++: #include <iostream>

int F[45] = {1, 1};

int fib_recurse(int n) {
    if (n < 2) {
        return 1;
    }
    return fib_recurse(n - 1) + fib_recurse(n - 2);
}

int fib_memo(int n) {
    if (n < 2) {
        return F[n] = 1;
    }
    if (F[n]) return F[n];
    return F[n] = fib_memo(n - 1) + fib_memo(n - 2);
}

int fib_dp(int n) {
    if(n < 2) {
        return F[n];
    }
    for (int i = 2; i <= n; i++) {
        F[n] = F[i - 1] + F[i - 2];
    }
}

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

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

template <class T> struct Matrix {
  vector<vector<T>> value;
  T init;

  Matrix(vector<vector<T>> vec,T init_) :init(init_), value(vec) {}
  Matrix(int h, int w, T init_) : init(init_) , value(h, vector<T>(w,init_)) {}

  Matrix<T> operator*(Matrix<T>& left) {
      Matrix<T> res(value.size(),left[0].size(),init);
      for(int i = 0;i < value.size();i++){
          for(int k = 0;k < left.size();k++){
              for(int j = 0;j < left[0].size();j++){
                  res[i][j] = (res[i][j] + value[i][k] * left[k][j]);
              }
          }
      }
      return res;
  }

  vector<T>& operator[](int n){
      return value[n];
  }

  size_t size(){
      return value.size();
  }

  Matrix<T> operator^(long long n){
      Matrix<T> a = *this;
      Matrix<T> res(a.size(),a.size(),init);
      for(int i = 0;i < a.size();i++){
          res[i][i] = 1;
      }

      while(n > 0){
          if(n & 1) res = res * a;
          a = a * a;
          n >>= 1;
      }
      return res;
  }
};



int main(){
    int n;
    cin >> n;
    Matrix<int> a({{1,1},{1,0}},0);
    cout << (a ^ (n + 1))[1][0] << endl;
}

C++: #include <iostream>
using namespace std;
int F[100];
int main() 
{
int n;
F[0] = 1;
F[1] = 1;
for (int i=2; i<45; ++i) 
{ // ???????????????
F[i] = F[i-2]+F[i-1];
}
cin>>n;
cout<<F[n]<<endl;
}

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

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

  cout << F[n] << endl;

  return 0;
}

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

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

  cout << F[n] << endl;

  return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	int n, t, a = 1, b = 1;
	cin >> n;
	while (n-- > 1)
		t = a, a = b, b += t;
	cout << b << endl;
}

C++: #include <stdio.h>

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

int main()
{
    int n;
    scanf("%d",&n);
    int a[n+1];
    printf("%d\n",fib(a,n));
}

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

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

int main(){
  int n,fibonacci;
  cin >> n;
  fibonacci = fib(n+1);
  cout << fibonacci << endl;
  return 0;
}

C++: //http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_10_A
#include <iostream>
using namespace std;

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


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

C++: #include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define N 44
lli F[N]={0};

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

}

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