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 <vector>

using namespace std;

typedef long long ll;

ll fib(int n) {
    vector<ll> memo(n + 1, 0);
    for (int i = 0; i < n + 1; i++) {
        if (i == 0 || i == 1) {
            memo[i] = 1;
        }
        else {
            memo[i] = memo[i - 1] + memo[i - 2];
        }
    }
    
    return memo[n];
}

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

    cout << fib(n) << endl;

    return 0;
}

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

void fnInput(vector<int>& rvnFibDP)
{
  int nMaxSiz;
  cin >> nMaxSiz;
  rvnFibDP.resize(nMaxSiz + 1, 0);

  if (nMaxSiz >= 2)     rvnFibDP[0] = rvnFibDP[1] = 1;
  else if (nMaxSiz = 1) rvnFibDP[0] = 1;
  else;
}

int fnFibNumber(vector<int>& rvnFibDP, int nNo)
{
  if (rvnFibDP[nNo])  return rvnFibDP[nNo];

  return rvnFibDP[nNo] = 
         fnFibNumber(rvnFibDP, nNo - 1) + fnFibNumber(rvnFibDP, nNo - 2);
}

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  vector<int> vnFibDP; 

  fnInput(vnFibDP);
  cout << fnFibNumber(vnFibDP, vnFibDP.size() - 1) << endl;
  return 0;
}

C++: #include<iostream>

using namespace std;

int main () {

    int n, F[45], i;

    cin >> n;

    F[0] = 1;
    F[1] = 1;

    for (i = 2; i <= n; i++) {

        F[i] = F[i - 1] + F[i - 2];

    }

    cout << F[n] << endl;

    return 0;

}

C++: #include <iostream>
#include <string.h>
#include <algorithm>
using namespace std;
int dp[100];
int fib(int n) {
	if (dp[n] >= 0) return dp[n];
	if (n == 0 || n == 1) return 1;
	return dp[n] = (fib(n - 1) + fib(n - 2));
}

int main() {
	int n; cin >> n;
	memset(dp, -1, sizeof(dp));
	cout << fib(n) << endl;
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main() {
    vector<int> F(100);
	int n;
	cin>>n;
	F[0]=1;
	F[1]=1;
	for(int i=2;i<=n;i++){
	    F[i]=F[i-2]+F[i-1];
	}
	cout<<F[n]<<'\n';
	return 0;       
}

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

int fib(int n){
	switch(n){
		case 0: return 1;
		case 1: return 1;
		default: return fib(n-1)+fib(n-2);
	}
}

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

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

int fibans[44];
bool fibflag[44];

int fib(int n){
  if(n<2)return 1;
  if(fibflag[n] != true){
    fibans[n] = fib(n-1) + fib(n-2);
    fibflag[n] = true;
  }
  return fibans[n];
} 

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

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

typedef long long ll;
const int INF = 1e9;

#define FOR( i, m, n )  for( int (i) = (m); (i) < (n); (i)++ )
#define REP( i, n )     FOR( i, 0, n )
#define ALL( a )        (a).begin(), (a).end()             

int dp[50] = {};

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

	dp[0] = 1; 
	dp[1] = 1;
	FOR( i, 2, 50 ) {
		dp[i] = dp[i - 1] + dp[i - 2];
	}

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

C++: #include <iostream>

using namespace std;
int Fibonacci(int n)
{
    int dp[n];
    for(int i=0;i<=n;i++)
    {
        if(i==0||i==1) dp[i]=1;
        else dp[i]=dp[i-1]+dp[i-2];
    }
    return dp[n];
}
int main()
{
    int n;
    while(cin>>n)
        cout<<Fibonacci(n)<<endl;
}

C++: #include<stdio.h>

int main(void){
    int n;
    scanf("%d",&n);

    if(n == 1 || n == 0)
        printf("1\n");
    else{
        long long pre1 = 1,pre2 = 1,ans = 0;
        for(int i = 2;i <= n;i++){
            ans = pre1 + pre2;
            pre2 = pre1;
            pre1 = ans;
        }
        printf("%lld\n",ans);
    }
    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] << end;
  
  return 0;
}

C++: #include <iostream>
using namespace std;
typedef unsigned long long ULL;
int main(){
	ULL a=1,b=1,c,n;
	cin>>n;
	for (ULL i=1;i<=n;++i){
		c=a+b;
		a=b;
		b=c;
	}
	cout<<a<<endl;
	return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define FORR(i, m, n) for (int i = (m); i >= (n); --i)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll mod2 = 998244353;

ll dp[50];

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