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 fib(int n);

int main() {
  int n;

  //入力
  cin >> n;

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

  return 0;
}

int fib(int n){
  /*　演習　*/
  if(n == 0) return 1;
  else if(n == 1) return 1;
  else return fib(n-1) + fib(n-2);
}

C++: #include<iostream>

using namespace std;

int fib(int n);

int main() {
  int n;

  //入力
  cin >> n;

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

  return 0;
}

int fib(int n){
  int memo[1000]={0};

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

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

int F[MAX];

void Fibonacci(){
  F[0] = 1; F[1] = 1;
  for( int i = 2 ; i < MAX ; i++ ) F[i] = F[i-2] + F[i-1];
}

int main(void){
  Fibonacci();
  int i;

  cin >> i;
  cout << F[i] << endl;

  return 0;
}

C++: #include<iostream>
#include<cstdio>
#define Lens 50
using namespace std;

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

C++: #include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);++i)
using namespace std;

int fibonacci[44];

int fib(int n){
    if(fibonacci[n]!=0){
        return fibonacci[n];
    }

    if(n==0||n==1){
        fibonacci[n] = 1;
        return 1;
    }

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

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

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

C++: #include <iostream>

using namespace std;

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

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

  cout << fib(n) << endl;

  return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#define FOR(i,b,e) for(int i=b;i<e;i++)
#define REP(i,n) FOR(i,0,n)
using namespace std;

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

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

  int n;
  cin >> n;
  int dp[n+1];
  REP(i, n+2) {
    if (i == 0 || i == 1) dp[i] = 1;
    else dp[i] = -1;
  }

  cout << fib(n, dp) << endl;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <array>
#include <queue>
#include <deque>
#include <set>
#include <unordered_set>
#include <list>
#include <map>
#include <stack>
#include <utility>
#include <bitset>
#include <complex>
#include <algorithm>
#include <numeric>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <climits>
#include <random>
#include <functional>
#include <sstream>
#include <iomanip>

using namespace std;

#define rep(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, m, n) for(int i=(m); i<(n); ++i)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define SORT(x) sort((x).begin(),(x).end())
#define REVE(x) reverse((x).begin(),(x).end())
#define mp make_pair
#define pb push_back
#define Cout(x) cout << (x) << endl
#define Cout2(x, y) cout << (x) << " " << (y) << endl
#define dump(x) cout << #x << " = " << (x) << endl;
#define forauto(i, a) for(auto i : a)cout << i << " "; puts("");

typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
typedef pair<double, double> PDD;
typedef complex<double> CD;

int main() {
	LL fib[47];
	fib[0] = 1;
	fib[1] = 1;
	FOR(i, 2, 45)fib[i] = fib[i - 1] + fib[i - 2];

	int n; cin >> n;
	cout << fib[n] << endl;
}

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

int main(){
  int n=0;
  int fib[55]={};
  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;
  return 0;
}

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

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

  cout << fn[n] << endl;
}
return 0;
}

C++: #include<cstdio>

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

C++: #include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(obj) (obj).begin(),(obj).end()

int main(){
    int m;
    cin>>m;
    int a[44];
    a[0]=1;
    a[1]=1;
    for(int i=2;i<=m;i++){
        a[i]=a[i-1]+a[i-2];
    }
    cout<<a[m]<<endl;
    return 0;
}

C++: #include <iostream>

using namespace std;

int fib(int n);

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

dp[0] = 1;
dp[1] = 1;

cin >> n;

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 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] << endl;
        delete [] fib;

        return 0;
}

C++: #include<stdio.h>

int fib(int);
int f[45];

int main()
{
  int a,n;

  scanf("%d",&n);

  a = fib(n);
  printf("%d\n",a);

  return 0;
}

int fib(int n){

  int a;

  if(a == f[n])
    return a;
  
  if(n==0 || n==1){
    a = 1;
  }
  else
    a = fib(n-1)+fib(n-2);

  f[n] = a;
  return a;
}

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