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++: /**
 * @copyright (c) 2020 Daisuke Hashimoto
 */

#include <cstdint>
#include <iostream>
#include <string>

constexpr int32_t kMaxNumberOfIndex = 100;

void CallFibonacciNumber(std::istream &input_stream);

class FibonacciNumber {
 public:
  FibonacciNumber() noexcept;
  ~FibonacciNumber() noexcept;
  int32_t Calculate(const int32_t n);

 private:
  FibonacciNumber(const FibonacciNumber &obj) = delete;
  FibonacciNumber &operator=(const FibonacciNumber &obj) = delete;
  FibonacciNumber(FibonacciNumber &&obj) = delete;
  FibonacciNumber &operator=(FibonacciNumber &&obj) = delete;

 private:
  int32_t values_[kMaxNumberOfIndex];
};

void CallFibonacciNumber(std::istream &input_stream) {
  input_stream.tie(0);
  std::ios::sync_with_stdio(false);
  FibonacciNumber *fibonacci_number = new FibonacciNumber();
  try {
    int32_t n;
    input_stream >> n;
    std::cout << fibonacci_number->Calculate(n) << std::endl;
  } catch (...) {
    std::cerr << "ERROR: CallFibonacciNumber()" << std::endl;
    throw;
  }
  delete fibonacci_number;
}

// ****************************************************

FibonacciNumber::FibonacciNumber() noexcept {
  values_[0] = 1;
  values_[1] = 1;
}
FibonacciNumber::~FibonacciNumber() noexcept {}

int32_t FibonacciNumber::Calculate(const int32_t n) {
  for (int32_t index = 2; index <= n; ++index) {
    values_[index] = values_[index - 1] + values_[index - 2];
  }
  return values_[n];
}

int main(int argc, char *argv[]) {
  try {
    CallFibonacciNumber(std::cin);
  } catch (...) {
    std::cerr << "ERROR: main()" << std::endl;
  }
  return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
typedef long long ll;
const int MAX=50;
ll f[MAX];
ll fib(int n){
	f[0]=f[1]=1;
	for(int i=2;i<=n;i++){
		f[i]=f[i-1]+f[i-2];
	}
	return f[n];
} 

int main(){
	int n;
	scanf("%d",&n);
	printf("%lld\n",fib(n));
	return 0;
}

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

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

int f[1000000] = {};

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

int fib2(int n){
    int ff[100000] = {};
    ff[0] = 1;
    ff[1] = 1;
    for(int i = 2; i <= n; i++){
        ff[i] = ff[i-2] + ff[i-1];
    }
    return ff[n];
}

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

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