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>
#include<stdio.h>
//#include <bits/stdc++.h>
#include<vector>
#include<float.h>
#include<iomanip>
#include<algorithm>
#include<string>
#include<cstring>
#include<math.h>
#include<cmath>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include <cassert>
#include <cmath>
#include<cstdint>

#define INF 1e9
#define rep(i,n)for(int i=0;(i)<(int)(n);i++)
#define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)
#define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;
#define vec(type,n) vector<type>(n)
#define vvec(m,n) vector<vector<int>> (int(m),vector<int>(n))
#define ALL(a)  (a).begin(),(a).end()

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

int main(){
    int n;
    while(cin>>n){
        int dp[n+1];
        dp[0] = 1;
        dp[1] = 1;
        REP(i,2,n){
            dp[i] = dp[i-1]+dp[i-2];
        }
        cout<<dp[n]<<endl;
    }
}

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

ll dp[1000000];

ll fib(ll n){
    if(dp[n] >= 0) return dp[n];

    if(n == 0) dp[n] = 0;
    else if(n == 1) dp[n] = 1;
    else dp[n] = fib(n-1) + fib(n-2);
    return dp[n];
}

int main(){
    ll n; cin >> n;
    memset(dp, -1, 1000000*sizeof(ll));

    cout << fib(n+1) << endl;
    return 0;
}

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

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

	// F[0] から F[n] までの分のメモリを確保
	vector<long long> dp(n + 1, 0);

	// 初期条件
	dp[0] = 1;
	dp[1] = 1;

	// DP の遷移を行う
	for (int i = 2; i <= n; ++i) {
		dp[i] += dp[i - 1];
		dp[i] += dp[i - 2];
	}

	// 答え
	cout << dp[n] << endl;
}

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

int main() {
    int n;
    cin>>n;
    int fib[100];
    fib[0] = 1;
    fib[1] = 1;

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

    cout<<fib[n]<<endl;
}

C++: #include <iostream>
#include<stdio.h>
using namespace std;
int main(void){
    int n,f[45];
    cin>>n;
    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>
#include<vector>
using namespace std;

int main(void){
	int n,v[50];
	cin>>n;
	if(n == 0 || n == 1){
		cout<<1<<endl;
	}else{
		v[0] = v[1] = 1;
		for(int i = 2 ; i <= n ; i ++){
			v[i] = v[i-1] + v[i-2];
		}
		cout<<v[n]<<endl;
	}
}

C++: #include<iostream>
#include<map>
#include<vector>
#include<algorithm>
#include<cmath>
#include<climits>
#include<ctime>
#include<cstring>
#include<numeric>

#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define dump(a) (cerr << #a << "=" << (a) << endl)
#define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;

using namespace std;

int main(){
  int n;
  int a[45];
  cin >> n;
  a[0] = 1;
  a[1] = 1;
  REP(i, 2, n+1){
    a[i] = a[i-1] + a[i-2];
  }

  cout << a[n] << endl;

}

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

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

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

#define MAX_N 44

int fib(int);

int dp[MAX_N+1];

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

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

int fib(int n) {
  dp[0] = 1;
  dp[1] = 1;

  if(n==0) return dp[0];
  if(n==1) return dp[1];

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

  return dp[n];
}

C++: #include<iostream>
using namespace std;
int fib(int p){
    if(p==0||p==1) return 1;
    else return fib(p-1)+fib(p-2);
}
int main(){
    int n;
    cin>>n;
    cout<<fib(n)<<endl;
    return 0;
}