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 solution(int n){
    if(n==0) return 1;
    if(n==1) return 1;
    return solution(n-1)+solution(n-2);
}

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

C++: #include <iostream>

using namespace std;

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

  // 初期化
  dp[0] = 1;
  dp[1] = 1;

  //入力
  cin >> n;

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

  // 出力
  cout << fib(n) << endl;

  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;

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

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

int main()
{
    int n;
    cin >> n;
    int F[50];
    F[0] = 1, 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 fibonacci(int i){
  int fib;
  if(i == 0 or i == 1){
    return 1;
  }else{
    fib = fibonacci(i - 1) + fibonacci(i - 2);
    return fib;
  }
  return 0;
}

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

  fn = fibonacci(n);

  cout << fn << endl;

  return 0;
}

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

using namespace std;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;

#define REP(i, n) for (int i = 0; i < (n); i++)

const ll MOD = 9223372036854775807; // 1e9+7;

vvl initialize(int r, int c) {
  /*
   * r行c列の2次元零行列
   */
  vvl I = vvl(r);
  REP (i, r) {
    I[i] = vl(c, 0);
  }
  return I;
}

vvl mul(vvl A, vvl B) { // A*B
  vvl C = initialize(A.size(), B[0].size());
  REP (i, A.size()) REP (k, B.size()) REP (j, B[0].size()) {
    C[i][j] = (C[i][j] + 1l * A[i][k] * B[k][j]) %MOD;
  }
  return C;
}

vvl pow(vvl A, ll n) { 
  /*
   * Aのn乗の行列
   * Aは正方行列
   */
  int d = A.size();
  vvl B = initialize(d, d);
  REP (i, d) B[i][i] = 1; // Aと同じ次元の単位行列を作成
  while (n > 0) {
    if (n&1) B = mul(A, B);
    A = mul(A, A);
    n >>= 1;
  }
  return B;
}

ll fibonacci(ll n) {
  vvl A = initialize(2,2);
  A[0][0] = A[0][1] = A[1][0] = 1;
  A[1][1] = 0;
  A = pow(A, n+1);
  return A[1][0];
}

ll n;

int main() {

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

C++: #include "bits/stdc++.h"
using namespace std;
int d;

int fib(int a){
	if(a==0||a==1)return 1;
	d=fib(a-1)+fib(a-2);
	return d;
}

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

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

int main() {

    int F[44];

    int n;

    cin >> n;

    F[0] = 0;
    F[1] = 1;
    F[2] = 1;
    for(int i = 3; i <= n; i++) F[i] = F[i-1] + F[i-2];

    cout << F[n] << endl;

    return 0;
}

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

typedef long int lint;
typedef long long int llint;
typedef pair<int, int> pii;
typedef pair<int, string> pis;
typedef pair<long, long> pll;

#define EACH(i, c) for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define ALL(c) (c).begin(), (c).end()
#define FOR(i, s, e) for (int i = (s); i < (int)(e); ++i)
#define REP(i, n) FOR(i, 0, n)
#define endl "\n"

const int INF = 100000000;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

template<typename T>
void print(const std::vector<T>& v, char sep=' ') {
  for (int i = 0; i < (int)v.size(); i++) {
    if (i != 0) cout << sep;
    cout << v[i];
  }
  cout << endl;
}

int fib[INF];

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int n;
  cin >> n;

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

C++: #include <stdio.h>
#define N 100
#define M -1
int fib(int);

int array[N];
int main()
{
  int i,n;
  scanf("%d",&n);
  for(i=0;i<N;i++)
    {
      array[i]=M;
    }
  printf("%d\n",fib(n));
}

int fib(int x)
{
  if(x==0||x==1)
    {
      return array[x];
    }
  else if(array[x]!=M) return array[x];
  else
    {
      array[x]=(fib(x-2)+fib(x-1));
    }
}

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

C++: #include <iostream>
using namespace std;
long long fib[50];

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

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

int main(){
  int n,a[2]={1,1};
  cin>>n;

  int c=0;
  for(int i=1;i<n;i++)a[c]=a[0]+a[1],c=!c;
  cout << a[!c]<<endl;
  return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
	int n;
	cin >> n;
	int fibo[n + 1] = { 1, 1 };

	for (int i = 2; i <= n; i++) {
		fibo[i] = fibo[i - 1] + fibo[i - 2];
	}
	cout << fibo[n] << endl;

	return 0;
}

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

int n;
vector<int> dp(50, 0);

int solve(int i){
    if(dp[i] > 0) return dp[i];
    if(i == 0) return dp[0] = 1;
    if(i == 1) return dp[1] = 1;
    return dp[i] = solve(i-1) + solve(i-2);
}

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

C++: #include<stdio.h>
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;

int main(){
	
	int n[47];
	n[0]=0;
	n[1]=1;n[2]=2;

	for(int i=3;i<=45;i++)
		n[i]=n[i-1]+n[i-2];
	int x;
	cin>>x;
	cout<<n[x]<<endl;
	return 0;
}