Go: package main

/*
フィボナッチ数列
*/

import (
	"bufio"
	"bytes"
	"fmt"
	"log"
	"os"
	"strconv"
	"strings"
)

func fibWithMemo(n int, memo map[int]int) int {
	if n == 0 || n == 1 {
		return 1
	}
	if val, ok := memo[n]; ok {
		return val
	}
	memo[n] = fibWithMemo(n-1, memo) + fibWithMemo(n-2, memo)
	return memo[n]
}

func fib(n int) int {
	memo := make(map[int]int)
	return fibWithMemo(n, memo)
}

func main() {
	scanner := makeScanner(1024)
	n := eGetInt(scanner)
	fmt.Println(fib(n))
}

////////////////////////////////////////////////////////////////////////////////
// ライブラリ
////////////////////////////////////////////////////////////////////////////////
func makeScanner(maxByte int) *bufio.Scanner {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Buffer(make([]uint8, 0, 8192), maxByte)
	return scanner
}
func makeWordScanner() *bufio.Scanner {
	scanner := makeScanner(8192)
	scanner.Split(bufio.ScanWords)
	return scanner
}
func eGetLine(r *bufio.Scanner) string {
	if r.Scan() {
		return r.Text()
	}
	err := r.Err()
	if err != nil {
		log.Fatal(err)
	}
	// EOF
	return ""
}
func eGetInt(r *bufio.Scanner) int {
	line := eGetLine(r)
	return eAtoi(line)
}
func eGetFields(r *bufio.Scanner) []string {
	line := eGetLine(r)
	return strings.Fields(line)
}
func eGetInts(r *bufio.Scanner) []int {
	fields := eGetFields(r)
	ints := make([]int, len(fields))
	for i := 0; i < len(ints); i++ {
		ints[i] = eAtoi(fields[i])
	}
	return ints
}
func eGetChars(r *bufio.Scanner) []string {
	line := eGetLine(r)
	return strings.Split(line, "")
}
func eAtoi(s string) int {
	n, err := strconv.Atoi(s)
	if err != nil {
		log.Fatal(err)
	}
	return n
}

type ints []int

func (s ints) String() string {
	var buf bytes.Buffer
	buf.WriteString("[")
	sep := ""
	for _, v := range s {
		buf.WriteString(fmt.Sprintf("%s%d", sep, v))
		sep = ", "
	}
	buf.WriteString("]")
	return buf.String()
}

func reverse(a ints) ints {
	r := make(ints, len(a))
	for i := 0; i < len(a); i++ {
		r[i] = a[len(a)-1-i]
	}
	return r
}
func max(a ints) (int, bool) {
	if len(a) == 0 {
		return 0, false
	}
	m := a[0]
	for _, e := range a {
		if e > m {
			m = e
		}
	}
	return m, true
}
func min(a []int) int {
	m := a[0]
	for _, v := range a {
		if v < m {
			m = v
		}
	}
	return m
}

func sum(a ints) int {
	if len(a) == 0 {
		return 0
	}
	sum := 0
	for _, e := range a {
		sum += e
	}
	return sum
}
func find(n int, a ints) int {
	for i, v := range a {
		if n == v {
			return i
		}
	}
	return -1
}

C++: #include<stdio.h>
#define MAX 44

int main(){
  int n, i; 
  int F[50];

  scanf("%d", &n);
  if(n>MAX){
    printf("Number must be smaller than 44!\n");
    return -1;
  }
  
  F[0] = F[1] = 1;
  for ( i = 2; i <= n; i++ ){
    F[i] = F[i-1] + F[i-2];
  }

  printf("%d\n", F[n]);

  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<bits/stdc++.h>
using namespace std;

int f[50];

int fibo(int n)
{
  if(n <= 1) return 1;
  else{
    if(f[n]){
      return f[n];
    }
    else{
      return f[n] = fibo(n-1)+fibo(n-2);
    }
  }
}

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

  cout << fibo(n) << endl;
  return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<stdlib.h>
#include<cstdio>
int fib(int);
using namespace std;
int main()
{
	int n,ans;
	cin >> n;
	ans = fib(n - 1);
	cout << ans << endl;
}
int fib(int n)
{
	if (n < 1)
		return 1;
	else
	{
		return fib(n - 1)+fib(n - 2);
	}
}

C++: // #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define Graph vector<vector<int>>
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1000000007;

int main(){
    int N;
    cin >> N;
    vector<int> A(50);
    A[0] = A[1] = 1;
    for(int i = 2; i <= N; i++){
        A[i] = A[i - 1] + A[i - 2];
    }
    cout << A[N] << endl;
}

C++: #include <iostream>

using namespace std;

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

    int a = 1, b = 1;
    if (n < 2) {
        cout << 1 << endl;
    } else {
        int ans;
        for (int i = 2; i <= n; ++i) {
            ans = a + b;
            b = a;
            a = ans;
        }

        cout << ans << endl;
    }

    return 0;
}

C++: // 
#include <bits/stdc++.h>
#define endl "\n"
#define _GLIBCXX_DEBUG //配列外参照エラー表示,gcc依存
#define rep(i,n) for(int i=0;i<int(n);i++)
#define SZ(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> ipair;
template <class T>ostream &operator<<(ostream &o,const vector<T>&v)
{o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}
namespace you {
    std::string to_string(char val) {
        return std::string(1, val);
        // return std::string{val};
        // you::to_string(char)
    }
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(12);

    int n;
    vector<int> dp(50);
    cin>>n;
    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 <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i < (b); i++)
#define rrep(i, a, b) for (int i = a; i >= (b); i--)
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <class T>
inline bool chmin(T& a, T b) {
   if (a > b) {
      a = b;
      return true;
   }
   return false;
}
template <class T>
inline bool chmax(T& a, T b) {
   if (a < b) {
      a = b;
      return true;
   }
   return false;
}
void hr() {
   cerr << "--------------" << endl;
}
const int INF = 1001001001;
const int MOD = 1000000007;
// const int MOD = 998244353;
int memo[100];
int f(int n) {
   if (memo[n] != 0) return memo[n];
   if (n == 0 || n == 1) return 1;
   return memo[n] = f(n - 1) + f(n - 2);
}
int main() {
   cin.tie(0);
   ios_base::sync_with_stdio(0);

   int n;
   cin >> n;
   int ans = f(n);
   cout << ans << endl;
   return 0;
}

C++: #include <iostream>

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

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

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

#define MAX_N 44

using namespace std;

int fibonacci[MAX_N];

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

  


int main(){
  for(int i=0;i<MAX_N;i++){
    fibonacci[i] = 0;
  }


  int n;
  cin >> n;
  cout << fibo(n);
  
}

C++: #include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i) 
#define PI acos(-1)

using namespace std;
using ll = long long;
using P = pair<int, int>;

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

    int n;
    cin>>n;
    vector<ll> fibs(n + 1);
    fibs[0] = 1;
    fibs[1] = 1;
    rep(i, n - 1) {
        fibs[i + 2] = fibs[i + 1] + fibs[i];
    }
    cout<<fibs[n]<<endl;
}

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

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

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

C++: #include <bits/stdc++.h>
using namespace std;
int a[45];
int main(){
  a[0]=a[1]=1;
  for(int i=2;i<45;++i){
  	a[i]=a[i-1]+a[i-2];
  }
  int n;
  cin>>n;
  cout<<a[n]<<endl;
}

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

#define int long long

const int N = 44 + 5;
int fib[N];

void pre(){
  fib[0] = 1, fib[1] = 1;
  for(int i = 2; i < N; i++){
	   fib[i] = fib[i - 1] + fib[i - 2];  
	}	
}

int32_t main(){
	pre();
	int n;
	cin >> n;
	cout << fib[n] << endl;
	
}