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++: /* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   main.cpp                                           :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: monoue <marvin@student.42.fr>              +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2020/04/22 12:30:15 by monoue            #+#    #+#             */
/*   Updated: 2020/04/30 05:57:50 by monoue           ###   ########.fr       */
/*                                                                            */
/* ************************************************************************** */

#include <bits/stdc++.h>

/* #include <boost/multi_array.hpp> */
/* #include <boost/optional.hpp> */
/* #include <boost/range/irange.hpp> */
/* #include <boost/range/algorithm.hpp> */
/* #include <boost/range/adaptors.hpp> */
/* #include <boost/multiprecision/cpp_int.hpp> */
/* #include <boost/algorithm/string/classification.hpp> // is_any_of */
/* #include <boost/algorithm/string/split.hpp> */
/* #include <boost/algorithm/string/join.hpp> */
/* #include <boost/algorithm/string/replace.hpp> */
/* #include <boost/math/tools/minima.hpp> */
/* namespace adaptor = boost::adaptors; */
/* using boost::math::tools::brent_find_minima; */
/* using boost::irange; */
/* using boost::algorithm::join; */
/* using boost::algorithm::split; */
/* using boost::algorithm::replace_all; */
/* using boost::multiprecision::cpp_int; */

#define MOD 1000000007;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define rrep(i, n) for (int i = (n); i >= 0; --i)

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

// TOP
void	Main()
{
	vector<ll>	V(45);
	V.at(0) = V.at(1) = 1;
	rep2(i, 2, 45)
		V.at(i) = V.at(i - 2) + V.at(i - 1);
	int	n;
	cin >> n;
	cout << V.at(n) << endl;
}
// END

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

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

int f[46]={0};

int fib(int n){
    if(n==0)    f[0] = 1;
    else if(n==1)   f[1] = 1;
    if(f[n]==0)    f[n] = fib(n-1)+fib(n-2);

    return f[n];
}

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

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

const long long INF = 1LL << 60;
const int IINF=100000000;
const int MOD = (int)1e9 + 7;
typedef long long ll;
//約数列挙
vector<long long> divisor(long long n) {
    vector<long long> ret;
    for (long long i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i * i != n) ret.push_back(n / i);
        }
    }
    //sort(ret.begin(), ret.end()); // 昇順に並べる
    return ret;
}
vector<int> dx={1,0,-1,0};vector<int> dy={0,-1,0,1};

vector<int> dp;
int N;
int calc(int n){
    ll res1,res2;
    dp[n-1]!=-1 ? res1 = dp[n-1] : res1 = calc(n-1);
    dp[n-2]!=-1 ? res2 = dp[n-2] : res2 = calc(n-2);
    return dp[n]=res1 + res2;
}
signed main () {
    scanf("%d",&N);
    dp.assign(N+1,-1);
    dp[0]=1;dp[1]=1;
    if(N-1<1){
        printf("1\n");
        return 0;
    }
    calc(N);
    printf("%d\n",dp[N]);
}

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 || n == 1){
    return 1;
  }else{
    return fib(n-1) + fib(n-2);
  }
}

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

int main() {
	
	int n;
	cin >> n;
	vector<int>fib(n+1);
	fib.at(0)=1;
	fib.at(1)=1;
	for(int i=2; i<=n; i++) fib.at(i) = fib.at(i-1) + fib.at(i-2);
	cout << fib.at(n) << endl;
}

C++: 

#include<stdio.h>
#define N 45
 
int main(){
int i,n,F[N];
F[0]=F[1]=1;

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

C++: #include<iostream>
#define MAX_N 45
int F[MAX_N];

int fib(int n){
   if(F[n]>0) return F[n];
   if(n==0 || n==1) return F[n]=1;
   return F[n]=F[n-1]+F[n-2];
}

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

C++: #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 44
int F[MAX]={};
int fibonacci(int);

int main()
{
  int n,memo;

  scanf("%d",&n);

  printf("%d\n",fibonacci(n));

  return 0;
}

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

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

int main(){
    int n;cin>>n;
    int F[n+1]={};F[0]=1;F[1]=1;
    for(int i=2;i<n+1;i++){
        F[i]=F[i-1]+F[i-2];//小さい値から計算していくので無駄がない.
    }
    cout<<F[n]<<endl;
    return 0;
}